Package org.bouncycastle.jcajce
Class ExternalPublicKey
- java.lang.Object
-
- org.bouncycastle.jcajce.ExternalPublicKey
-
- All Implemented Interfaces:
java.io.Serializable
,java.security.Key
,java.security.PublicKey
public class ExternalPublicKey extends java.lang.Object implements java.security.PublicKey
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.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ExternalPublicKey(java.security.PublicKey key, GeneralName location, java.security.MessageDigest digest)
Helper constructor with JCA contents.ExternalPublicKey(ExternalValue extKey)
Base constructor with ASN.1 structure.ExternalPublicKey(GeneralName location, AlgorithmIdentifier digestAlg, byte[] digest)
Base constructor with fundamental contents.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAlgorithm()
Return "ExternalKey"byte[]
getEncoded()
Return a SubjectPublicKeyInfo structure containing an ExternalValue encoding for the key.java.lang.String
getFormat()
Return "X.509" (DER encoded SubjectPublicKeyInfo)
-
-
-
Constructor Detail
-
ExternalPublicKey
public ExternalPublicKey(GeneralName location, AlgorithmIdentifier digestAlg, byte[] digest)
Base constructor with fundamental contents.- Parameters:
location
- location URI for the actual public key.digestAlg
- hashing algorithm used to hash the actual public key encoding.digest
- digest of the actual public key.
-
ExternalPublicKey
public ExternalPublicKey(java.security.PublicKey key, GeneralName location, java.security.MessageDigest digest)
Helper constructor with JCA contents.- Parameters:
key
- the public key we are externalising.location
- location URI for the actual public key.digest
- digest to use for hashing the key.
-
ExternalPublicKey
public ExternalPublicKey(ExternalValue extKey)
Base constructor with ASN.1 structure.- Parameters:
extKey
- structure with location, hashing algorithm and hash for the public key.
-
-
Method Detail
-
getAlgorithm
public java.lang.String getAlgorithm()
Return "ExternalKey"- Specified by:
getAlgorithm
in interfacejava.security.Key
- Returns:
- "ExternalKey"
-
getFormat
public java.lang.String getFormat()
Return "X.509" (DER encoded SubjectPublicKeyInfo)- Specified by:
getFormat
in interfacejava.security.Key
- Returns:
- "X.509"
-
getEncoded
public byte[] getEncoded()
Return a SubjectPublicKeyInfo structure containing an ExternalValue encoding for the key.- Specified by:
getEncoded
in interfacejava.security.Key
- Returns:
- a DER encoding of SubjectPublicKeyInfo containing an ExternalValue structure.
-
-