|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.data.DataStructureImpl
net.i2p.data.Certificate
net.i2p.data.KeyCertificate
public class KeyCertificate
This certificate type gets its own class because it's going to be used a lot. The crypto type is assumed to be always 0x0000 (ElG) for now.
Field Summary | |
---|---|
(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
|
Fields inherited from class net.i2p.data.Certificate |
---|
_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 Summary | |
---|---|
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. |
Method Summary | |
---|---|
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()
|
Methods inherited from class net.i2p.data.Certificate |
---|
create, create, equals, getCertificateType, getPayload, hashCode, readBytes, readBytes, setCertificateType, setPayload, size, writeBytes, writeBytes |
Methods inherited from class net.i2p.data.DataStructureImpl |
---|
calculateHash, fromBase64, fromByteArray, read, toBase64, toByteArray |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public KeyCertificate(byte[] payload) throws DataFormatException
payload
- 4 bytes minimum if non-null
DataFormatException
public KeyCertificate(SigningPublicKey spk)
spk
- non-null data non-null
IllegalArgumentException
public KeyCertificate(SigType type)
type
- non-null
IllegalArgumentException
public KeyCertificate(Certificate cert) throws DataFormatException
cert
- payload 4 bytes minimum if non-null
DataFormatException
- if cert type != CERTIFICATE_TYPE_KEYMethod Detail |
---|
public 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |