public static class KeyStoreTestSupport.MCertificate extends Certificate
Certificate.CertificateRep
Constructor and Description |
---|
KeyStoreTestSupport.MCertificate(String type,
byte[] encoding) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getEncoded()
Returns the encoded representation for this certificate.
|
PublicKey |
getPublicKey()
Returns the public key corresponding to this certificate.
|
String |
toString()
Returns a string containing a concise, human-readable description of the
certificate.
|
void |
verify(PublicKey key)
Verifies that this certificate was signed with the given public key.
|
void |
verify(PublicKey key,
String sigProvider)
Verifies that this certificate was signed with the given public key.
|
equals, getType, hashCode, writeReplace
public KeyStoreTestSupport.MCertificate(String type, byte[] encoding)
public byte[] getEncoded() throws CertificateEncodingException
Certificate
getEncoded
in class Certificate
CertificateEncodingException
- if the encoding fails.public void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
Certificate
verify
in class Certificate
key
- PublicKey public key for which verification should be
performed.CertificateException
- if encoding errors are detected.NoSuchAlgorithmException
- if an unsupported algorithm is detected.InvalidKeyException
- if an invalid key is detected.NoSuchProviderException
- if there is no default provider.SignatureException
- if signature errors are detected.public void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
Certificate
verify
in class Certificate
key
- PublicKey public key for which verification should be
performed.sigProvider
- String the name of the signature provider.CertificateException
- if encoding errors are detected.NoSuchAlgorithmException
- if an unsupported algorithm is detected.InvalidKeyException
- if an invalid key is detected.NoSuchProviderException
- if the specified provider does not exists.SignatureException
- if signature errors are detected.public String toString()
Certificate
toString
in class Certificate
public PublicKey getPublicKey()
Certificate
getPublicKey
in class Certificate