65 * implementation from the provider with the highest precedence, |
65 * implementation from the provider with the highest precedence, |
66 * which may be this class. |
66 * which may be this class. |
67 */ |
67 */ |
68 static Signature getInstance() throws NoSuchAlgorithmException { |
68 static Signature getInstance() throws NoSuchAlgorithmException { |
69 return JsseJce.getSignature(JsseJce.SIGNATURE_SSLRSA); |
69 return JsseJce.getSignature(JsseJce.SIGNATURE_SSLRSA); |
70 } |
|
71 |
|
72 /** |
|
73 * Get an internal implementation for the RSA signature. |
|
74 * |
|
75 * Used for RSA client authentication, which needs the ability to set |
|
76 * the digests to externally provided values via the setHashes() method. |
|
77 */ |
|
78 static Signature getInternalInstance() |
|
79 throws NoSuchAlgorithmException, NoSuchProviderException { |
|
80 return Signature.getInstance(JsseJce.SIGNATURE_SSLRSA, "SunJSSE"); |
|
81 } |
|
82 |
|
83 /** |
|
84 * Set the MD5 and SHA hashes to the provided objects. |
|
85 */ |
|
86 @SuppressWarnings("deprecation") |
|
87 static void setHashes(Signature sig, MessageDigest md5, MessageDigest sha) { |
|
88 sig.setParameter("hashes", new MessageDigest[] {md5, sha}); |
|
89 } |
70 } |
90 |
71 |
91 @Override |
72 @Override |
92 protected void engineInitVerify(PublicKey publicKey) |
73 protected void engineInitVerify(PublicKey publicKey) |
93 throws InvalidKeyException { |
74 throws InvalidKeyException { |