Completed
Push — master ( 6c40ed...665ea8 )
by sebastian
01:26
created

rsa/PKCS1/RSA1_5_KeyManagementAlgorithm.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php namespace jwa\cryptographic_algorithms\key_management\rsa\PKCS1;
2
/**
3
 * Copyright 2015 OpenStack Foundation
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 * http://www.apache.org/licenses/LICENSE-2.0
8
 * Unless required by applicable law or agreed to in writing, software
9
 * distributed under the License is distributed on an "AS IS" BASIS,
10
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
 * See the License for the specific language governing permissions and
12
 * limitations under the License.
13
 **/
14
use jwa\cryptographic_algorithms\key_management\rsa\RSA_KeyManagementAlgorithm;
15
use jwa\JSONWebSignatureAndEncryptionAlgorithms;
16
use phpseclib\Crypt\RSA;
17
/**
18
 * Class RSA1_5_KeyManagementAlgorithm
19
 * @package jwa\cryptographic_algorithms\key_management\rsa\PKCS1
20
 */
21 View Code Duplication
final class RSA1_5_KeyManagementAlgorithm extends RSA_KeyManagementAlgorithm
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
{
23
24
    /**
25
     * @return string
26
     */
27
    public function getHashingAlgorithm()
28
    {
29
        return 'sha1';
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getName()
36
    {
37
        return JSONWebSignatureAndEncryptionAlgorithms::RSA1_5;
38
    }
39
40
    /**
41
     * @return int
42
     */
43
    public function getEncryptionMode()
44
    {
45
        return RSA::ENCRYPTION_PKCS1;
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getMGFHash()
52
    {
53
        return $this->getHashingAlgorithm();
54
    }
55
56
    /**
57
     * hash key size in bits
58
     * @return int
59
     */
60
    public function getHashKeyLen()
61
    {
62
        return 1;
63
    }
64
}