Bouncy Castle Cryptography Library 1.87

org.bouncycastle.mozilla.jcajce
Class JcaSignedPublicKeyAndChallenge

java.lang.Object
  extended byorg.bouncycastle.mozilla.SignedPublicKeyAndChallenge
      extended byorg.bouncycastle.mozilla.jcajce.JcaSignedPublicKeyAndChallenge
All Implemented Interfaces:
org.bouncycastle.util.Encodable

public class JcaSignedPublicKeyAndChallenge
extends SignedPublicKeyAndChallenge

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 org.bouncycastle.mozilla.SignedPublicKeyAndChallenge
spkacSeq
 
Constructor Summary
JcaSignedPublicKeyAndChallenge(byte[] bytes)
          Parse a SignedPublicKeyAndChallenge from its DER encoding.
 
Method Summary
 java.security.PublicKey getPublicKey()
          Return the public key carried by the SPKAC as a JCA PublicKey, decoded via the provider configured by setProvider(java.lang.String).
 JcaSignedPublicKeyAndChallenge setProvider(java.security.Provider provider)
          Return a new holder that pins KeyFactory lookups to the supplied JCE provider.
 JcaSignedPublicKeyAndChallenge setProvider(java.lang.String providerName)
          Return a new holder that pins KeyFactory lookups to the named JCE provider.
 
Methods inherited from class org.bouncycastle.mozilla.SignedPublicKeyAndChallenge
getChallenge, getEncoded, getPublicKey, getPublicKeyAndChallenge, getSubjectPublicKeyInfo, isSignatureValid, toASN1Primitive, toASN1Structure, verify, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcaSignedPublicKeyAndChallenge

public JcaSignedPublicKeyAndChallenge(byte[] bytes)
Parse a SignedPublicKeyAndChallenge from its DER encoding.

Parameters:
bytes - the encoded SPKAC bytes.
Method Detail

setProvider

public JcaSignedPublicKeyAndChallenge setProvider(java.lang.String providerName)
Return a new holder that pins KeyFactory lookups to the named JCE provider.

Parameters:
providerName - the name of the JCE provider to use.
Returns:
a new JcaSignedPublicKeyAndChallenge bound to .

setProvider

public JcaSignedPublicKeyAndChallenge setProvider(java.security.Provider provider)
Return a new holder that pins KeyFactory lookups to the supplied JCE provider.

Parameters:
provider - the JCE provider to use.
Returns:
a new JcaSignedPublicKeyAndChallenge bound to .

getPublicKey

public java.security.PublicKey getPublicKey()
                                     throws java.security.NoSuchAlgorithmException,
                                            java.security.NoSuchProviderException,
                                            java.security.InvalidKeyException
Return the public key carried by the SPKAC as a JCA PublicKey, decoded via the provider configured by setProvider(java.lang.String).

Returns:
the decoded public key.
Throws:
java.security.NoSuchAlgorithmException - if no KeyFactory matches the SPKI algorithm.
java.security.NoSuchProviderException - if the named provider is not registered.
java.security.InvalidKeyException - if the SPKI cannot be decoded into a usable key.

Bouncy Castle Cryptography Library 1.87