public class CertificateV2 extends Data
| Modifier and Type | Class and Description |
|---|---|
static class |
CertificateV2.Error
A CertificateV2.Error extends Exception and represents errors for not
complying with the certificate format.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
ISSUER_ID_OFFSET |
static Name.Component |
KEY_COMPONENT |
static int |
KEY_COMPONENT_OFFSET |
static int |
KEY_ID_OFFSET |
static int |
MIN_CERT_NAME_LENGTH |
static int |
MIN_KEY_NAME_LENGTH |
static int |
VERSION_OFFSET |
| Constructor and Description |
|---|
CertificateV2()
Create a CertificateV2 with content type KEY and default or unspecified
values.
|
CertificateV2(Data data)
Create a CertificateV2 from the content in the Data packet.
|
| Modifier and Type | Method and Description |
|---|---|
static Name |
extractIdentityFromCertName(Name certificateName)
Extract the identity namespace from certificateName.
|
static Name |
extractKeyNameFromCertName(Name certificateName)
Extract key name from certificateName.
|
Name |
getIdentity()
Get the identity name from the certificate name.
|
Name.Component |
getIssuerId()
Get the issuer ID component from the certificate name.
|
Name.Component |
getKeyId()
Get the key ID component from the certificate name.
|
Name |
getKeyName()
Get key name from the certificate name.
|
Blob |
getPublicKey()
Get the public key DER encoding.
|
ValidityPeriod |
getValidityPeriod()
Get the certificate validity period from the SignatureInfo.
|
boolean |
isValid()
Check if the current time falls within the validity period.
|
boolean |
isValid(double time)
Check if the time falls within the validity period.
|
static boolean |
isValidName(Name certificateName)
Check if certificateName follows the naming convention for a certificate.
|
void |
printCertificate(StringBuffer result)
Write a string representation of this certificate to result.
|
String |
toString()
Use printCertificate to return a string representation of this certificate.
|
void |
wireDecode(Blob input,
WireFormat wireFormat)
Override to call the base class wireDecode then check the certificate
format.
|
getChangeCount, getCongestionMark, getContent, getDefaultWireEncoding, getFullName, getFullName, getIncomingFaceId, getMetaInfo, getName, getSignature, setContent, setLpPacket, setMetaInfo, setName, setSignature, wireDecode, wireDecode, wireDecode, wireEncode, wireEncodepublic static final int VERSION_OFFSET
public static final int ISSUER_ID_OFFSET
public static final int KEY_ID_OFFSET
public static final int KEY_COMPONENT_OFFSET
public static final int MIN_CERT_NAME_LENGTH
public static final int MIN_KEY_NAME_LENGTH
public static final Name.Component KEY_COMPONENT
public CertificateV2()
public CertificateV2(Data data) throws CertificateV2.Error
data - The data packet with the content to copy.CertificateV2.Error - If data does not follow the certificate format.public final Name getKeyName()
public final Name getIdentity()
public final Name.Component getKeyId()
public final Name.Component getIssuerId()
public final Blob getPublicKey() throws CertificateV2.Error
CertificateV2.Error - If the public key is not set.public final ValidityPeriod getValidityPeriod()
IllegalArgumentException - If the SignatureInfo doesn't have a
ValidityPeriod.public final boolean isValid(double time)
time - The time to check as milliseconds since Jan 1, 1970 UTC.IllegalArgumentException - If the SignatureInfo doesn't have a
ValidityPeriod.public final boolean isValid()
IllegalArgumentException - If the SignatureInfo doesn't have a
ValidityPeriod.public void printCertificate(StringBuffer result)
result - The StringBuffer to write to.public void wireDecode(Blob input, WireFormat wireFormat) throws EncodingException
wireDecode in class Datainput - The input byte array to be decoded as an immutable Blob.wireFormat - A WireFormat object used to decode the input.EncodingException - For invalid encoding.public String toString()
public static boolean isValidName(Name certificateName)
certificateName - The name of the certificate.public static Name extractIdentityFromCertName(Name certificateName)
certificateName - The name of the certificate.Copyright © 2019. All rights reserved.