@@ -30,26 +30,26 @@ public static boolean isSigningAlgorithm(int publicKeyAlgorithm)
30
30
}
31
31
}
32
32
33
- // /**
34
- // * Return true, if the public key algorithm that corresponds to the given ID is capable of encryption.
35
- // * @param publicKeyAlgorithm public key algorithm id
36
- // * @return true if algorithm can encrypt
37
- // */
38
- // public static boolean isEncryptionAlgorithm(int publicKeyAlgorithm)
39
- // {
40
- // switch (publicKeyAlgorithm)
41
- // {
42
- // case PublicKeyAlgorithmTags.RSA_GENERAL:
43
- // case PublicKeyAlgorithmTags.RSA_ENCRYPT:
44
- // case PublicKeyAlgorithmTags.ELGAMAL_ENCRYPT:
45
- // case PublicKeyAlgorithmTags.ECDH:
46
- // case PublicKeyAlgorithmTags.ELGAMAL_GENERAL:
47
- // case PublicKeyAlgorithmTags.DIFFIE_HELLMAN:
48
- // case PublicKeyAlgorithmTags.X25519:
49
- // case PublicKeyAlgorithmTags.X448:
50
- // return true;
51
- // default:
52
- // return false;
53
- // }
54
- // }
33
+ /**
34
+ * Return true, if the public key algorithm that corresponds to the given ID is capable of encryption.
35
+ * @param publicKeyAlgorithm public key algorithm id
36
+ * @return true if algorithm can encrypt
37
+ */
38
+ public static boolean isEncryptionAlgorithm (int publicKeyAlgorithm )
39
+ {
40
+ switch (publicKeyAlgorithm )
41
+ {
42
+ case PublicKeyAlgorithmTags .RSA_GENERAL :
43
+ case PublicKeyAlgorithmTags .RSA_ENCRYPT :
44
+ case PublicKeyAlgorithmTags .ELGAMAL_ENCRYPT :
45
+ case PublicKeyAlgorithmTags .ECDH :
46
+ case PublicKeyAlgorithmTags .ELGAMAL_GENERAL :
47
+ case PublicKeyAlgorithmTags .DIFFIE_HELLMAN :
48
+ case PublicKeyAlgorithmTags .X25519 :
49
+ case PublicKeyAlgorithmTags .X448 :
50
+ return true ;
51
+ default :
52
+ return false ;
53
+ }
54
+ }
55
55
}
0 commit comments