Top Description Fields Constructors Methods
org.bouncycastle.jcajce

public Class ExternalPublicKey

extends Object
implements PublicKey
Class Inheritance
All Implemented Interfaces
java.security.PublicKey, java.security.AsymmetricKey, java.security.Key, java.io.Serializable
Imports
java.io.IOException, java.security.MessageDigest, .PublicKey, org.bouncycastle.asn1.ASN1Encoding, org.bouncycastle.asn1.bc.BCObjectIdentifiers, .ExternalValue, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .GeneralName, .SubjectPublicKeyInfo, org.bouncycastle.jcajce.util.MessageDigestUtils, org.bouncycastle.util.Arrays

Wrapper class which returns an "ExternalValue" for the public key encoding. In this case the key encoding is a hash and the actual key needs to be looked up somewhere else. Useful for where the public keys are really large but it's required to keep certificates small.

Field Summary

Modifier and TypeField and Description
private final byte[]
private final AlgorithmIdentifier
private final GeneralName

Constructor Summary

AccessConstructor and Description
public
ExternalPublicKey(GeneralName
location URI for the actual public key.
location
,
AlgorithmIdentifier
hashing algorithm used to hash the actual public key encoding.
digestAlg
,
byte[]
digest of the actual public key.
digest
)

Base constructor with fundamental contents.

public
ExternalPublicKey(PublicKey
the public key we are externalising.
key
,
GeneralName
location URI for the actual public key.
location
,
MessageDigest
digest to use for hashing the key.
digest
)

Helper constructor with JCA contents.

public
ExternalPublicKey(ExternalValue
structure with location, hashing algorithm and hash for the public key.
extKey
)

Base constructor with ASN.1 structure.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

"ExternalKey"
getAlgorithm
()

Implements java.security.Key.getAlgorithm.

Return "ExternalKey"

public byte[]

Returns:

a DER encoding of SubjectPublicKeyInfo containing an ExternalValue structure.
getEncoded
()

Implements java.security.Key.getEncoded.

Return a SubjectPublicKeyInfo structure containing an ExternalValue encoding for the key.

public String

Returns:

"X.509"
getFormat
()

Implements java.security.Key.getFormat.

Return "X.509" (DER encoded SubjectPublicKeyInfo)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

digestback to summary
private final byte[] digest
digestAlgback to summary
private final AlgorithmIdentifier digestAlg
locationback to summary
private final GeneralName location

Constructor Detail

ExternalPublicKeyback to summary
public ExternalPublicKey(GeneralName location, AlgorithmIdentifier digestAlg, byte[] digest)

Base constructor with fundamental contents.

Parameters
location:GeneralName

location URI for the actual public key.

digestAlg:AlgorithmIdentifier

hashing algorithm used to hash the actual public key encoding.

digest:byte[]

digest of the actual public key.

ExternalPublicKeyback to summary
public ExternalPublicKey(PublicKey key, GeneralName location, MessageDigest digest)

Helper constructor with JCA contents.

Parameters
key:PublicKey

the public key we are externalising.

location:GeneralName

location URI for the actual public key.

digest:MessageDigest

digest to use for hashing the key.

ExternalPublicKeyback to summary
public ExternalPublicKey(ExternalValue extKey)

Base constructor with ASN.1 structure.

Parameters
extKey:ExternalValue

structure with location, hashing algorithm and hash for the public key.

Method Detail

getAlgorithmback to summary
public String getAlgorithm()

Implements java.security.Key.getAlgorithm.

Return "ExternalKey"

Returns:String

"ExternalKey"

getEncodedback to summary
public byte[] getEncoded()

Implements java.security.Key.getEncoded.

Return a SubjectPublicKeyInfo structure containing an ExternalValue encoding for the key.

Returns:byte[]

a DER encoding of SubjectPublicKeyInfo containing an ExternalValue structure.

getFormatback to summary
public String getFormat()

Implements java.security.Key.getFormat.

Return "X.509" (DER encoded SubjectPublicKeyInfo)

Returns:String

"X.509"