Lines Matching refs:publicKey
45 private static void testSignature(String algorithm, PrivateKey privateKey, PublicKey publicKey) throws Exception {
51 s.initVerify(publicKey);
59 private static void test(PrivateKey privateKey, PublicKey publicKey) throws Exception {
60 testSignature("MD2withRSA", privateKey, publicKey);
61 testSignature("MD5withRSA", privateKey, publicKey);
62 testSignature("SHA1withRSA", privateKey, publicKey);
63 testSignature("SHA256withRSA", privateKey, publicKey);
64 RSAPublicKey rsaKey = (RSAPublicKey)publicKey;
67 testSignature("SHA384withRSA", privateKey, publicKey);
68 testSignature("SHA512withRSA", privateKey, publicKey);
118 RSAPublicKey publicKey = (RSAPublicKey)kp.getPublic();
119 System.out.println(publicKey);
121 if (publicKey.getModulus().equals(privateKey.getModulus()) == false) {
124 if (publicKey.getPublicExponent().equals(privateKey.getPublicExponent()) == false) {
127 int keyLen = publicKey.getModulus().bitLength();
132 if (exp.equals(publicKey.getPublicExponent()) == false) {
136 test(privateKey, publicKey);