public class KeyCertificate extends Certificate
Modifier and Type | Field and Description |
---|---|
(package private) static byte[] |
ECDSA256_PAYLOAD |
(package private) static byte[] |
Ed25519_PAYLOAD |
static KeyCertificate |
ELG_ECDSA256_CERT
An immutable ElG/ECDSA-P256 certificate.
|
static KeyCertificate |
ELG_Ed25519_CERT
An immutable ElG/Ed25519 certificate.
|
static int |
HEADER_LENGTH |
_payload, _type, CERTIFICATE_LENGTH_SIGNED_WITH_HASH, CERTIFICATE_TYPE_HASHCASH, CERTIFICATE_TYPE_HIDDEN, CERTIFICATE_TYPE_KEY, CERTIFICATE_TYPE_MULTIPLE, CERTIFICATE_TYPE_NULL, CERTIFICATE_TYPE_SIGNED, NULL_CERT
Constructor and Description |
---|
KeyCertificate(byte[] payload) |
KeyCertificate(Certificate cert)
Up-convert a cert to this class
|
KeyCertificate(SigningPublicKey spk)
A KeyCertificate with crypto type 0 (ElGamal)
and the signature type and extra data from the given public key.
|
KeyCertificate(SigType type)
A KeyCertificate with crypto type 0 (ElGamal)
and the signature type as specified.
|
Modifier and Type | Method and Description |
---|---|
int |
getCryptoTypeCode() |
byte[] |
getExtraKeyData()
Signing Key extra data, if any, is first in the array.
|
byte[] |
getExtraSigningKeyData()
Signing Key extra data, if any.
|
SigType |
getSigType() |
int |
getSigTypeCode() |
KeyCertificate |
toKeyCertificate()
Up-convert this to a KeyCertificate
|
String |
toString() |
create, create, equals, getCertificateType, getPayload, hashCode, readBytes, readBytes, setCertificateType, setPayload, size, writeBytes, writeBytes
calculateHash, fromBase64, fromByteArray, read, toBase64, toByteArray
public static final int HEADER_LENGTH
static final byte[] Ed25519_PAYLOAD
static final byte[] ECDSA256_PAYLOAD
public static final KeyCertificate ELG_ECDSA256_CERT
public static final KeyCertificate ELG_Ed25519_CERT
public KeyCertificate(byte[] payload) throws DataFormatException
payload
- 4 bytes minimum if non-nullDataFormatException
public KeyCertificate(SigningPublicKey spk)
spk
- non-null data non-nullIllegalArgumentException
public KeyCertificate(SigType type)
type
- non-nullIllegalArgumentException
public KeyCertificate(Certificate cert) throws DataFormatException
cert
- payload 4 bytes minimum if non-nullDataFormatException
- if cert type != CERTIFICATE_TYPE_KEYpublic int getSigTypeCode()
public int getCryptoTypeCode()
public SigType getSigType()
public byte[] getExtraKeyData()
public byte[] getExtraSigningKeyData()
UnsupportedOperationException
- if the sig type is unsupportedpublic KeyCertificate toKeyCertificate()
Certificate
toKeyCertificate
in class Certificate
public String toString()
toString
in class Certificate