Class JcaSignedPublicKeyAndChallenge
java.lang.Object
org.bouncycastle.mozilla.SignedPublicKeyAndChallenge
org.bouncycastle.mozilla.jcajce.JcaSignedPublicKeyAndChallenge
- All Implemented Interfaces:
org.bouncycastle.util.Encodable
This is designed to parse the SignedPublicKeyAndChallenge created by the
KEYGEN tag included by Mozilla based browsers.
PublicKeyAndChallenge ::= SEQUENCE {
spki SubjectPublicKeyInfo,
challenge IA5STRING
}
SignedPublicKeyAndChallenge ::= SEQUENCE {
publicKeyAndChallenge PublicKeyAndChallenge,
signatureAlgorithm AlgorithmIdentifier,
signature BIT STRING
}
-
Field Summary
Fields inherited from class SignedPublicKeyAndChallenge
spkacSeq -
Constructor Summary
ConstructorsConstructorDescriptionJcaSignedPublicKeyAndChallenge(byte[] bytes) Parse a SignedPublicKeyAndChallenge from its DER encoding. -
Method Summary
Modifier and TypeMethodDescriptionReturn the public key carried by the SPKAC as a JCAPublicKey, decoded via the provider configured bysetProvider(String).setProvider(String providerName) Return a new holder that pinsKeyFactorylookups to the named JCE provider.setProvider(Provider provider) Return a new holder that pinsKeyFactorylookups to the supplied JCE provider.Methods inherited from class SignedPublicKeyAndChallenge
getChallenge, getEncoded, getPublicKey, getPublicKeyAndChallenge, getSubjectPublicKeyInfo, isSignatureValid, toASN1Primitive, toASN1Structure, verify, verify
-
Constructor Details
-
JcaSignedPublicKeyAndChallenge
public JcaSignedPublicKeyAndChallenge(byte[] bytes) Parse a SignedPublicKeyAndChallenge from its DER encoding.- Parameters:
bytes- the encoded SPKAC bytes.
-
-
Method Details
-
setProvider
Return a new holder that pinsKeyFactorylookups to the named JCE provider.- Parameters:
providerName- the name of the JCE provider to use.- Returns:
- a new JcaSignedPublicKeyAndChallenge bound to
providerName.
-
setProvider
Return a new holder that pinsKeyFactorylookups to the supplied JCE provider.- Parameters:
provider- the JCE provider to use.- Returns:
- a new JcaSignedPublicKeyAndChallenge bound to
provider.
-
getPublicKey
public PublicKey getPublicKey() throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyExceptionReturn the public key carried by the SPKAC as a JCAPublicKey, decoded via the provider configured bysetProvider(String).- Returns:
- the decoded public key.
- Throws:
NoSuchAlgorithmException- if no KeyFactory matches the SPKI algorithm.NoSuchProviderException- if the named provider is not registered.InvalidKeyException- if the SPKI cannot be decoded into a usable key.
-