public class OpenSshCertificateImpl extends java.lang.Object implements OpenSshCertificate
OpenSshCertificate.CertificateOption, OpenSshCertificate.Type| Modifier and Type | Field and Description |
|---|---|
private java.security.PublicKey |
caPubKey |
private java.security.PublicKey |
certificatePublicKey |
private java.util.List<OpenSshCertificate.CertificateOption> |
criticalOptions |
private java.util.List<OpenSshCertificate.CertificateOption> |
extensions |
private java.lang.String |
id |
private java.lang.String |
keyType |
private byte[] |
message |
private byte[] |
nonce |
private java.util.Collection<java.lang.String> |
principals |
private java.lang.String |
reserved |
private long |
serial |
private static long |
serialVersionUID |
private byte[] |
signature |
private int |
type |
private long |
validAfter |
private long |
validBefore |
INFINITY, MIN_EPOCH| Constructor and Description |
|---|
OpenSshCertificateImpl() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAlgorithm() |
java.security.PublicKey |
getCaPubKey()
Retrieves the CA public key of this certificate.
|
java.security.PublicKey |
getCertPubKey()
Retrieves the certified public key.
|
java.util.List<OpenSshCertificate.CertificateOption> |
getCriticalOptions()
Retrieves the critical options set in the certificate.
|
byte[] |
getEncoded() |
java.util.List<OpenSshCertificate.CertificateOption> |
getExtensions()
Retrieves the extensions set in the certificate.
|
java.lang.String |
getFormat() |
java.lang.String |
getId()
Retrieves a free-form text set by the CA when the certificate was generated; intended to identify the identity
principal in log message.
|
java.lang.String |
getKeyType()
Retrieves the SSH key type of this certificate.
|
byte[] |
getMessage()
Retrieves the raw byte content of the certificate, minus the signature.
|
byte[] |
getNonce()
Retrieves the nonce of this certificate.
|
java.util.Collection<java.lang.String> |
getPrincipals()
Retrieves the principals mentioned in the certificate.
|
java.lang.String |
getRawKeyType()
Retrieves the raw SSH key type of this certificate.
|
byte[] |
getRawSignature()
Retrieves the raw signature bytes, without the signature algorithm.
|
java.lang.String |
getReserved()
Retrieves the "reserved" field of the certificate.
|
long |
getSerial()
Retrieves the serial number of this certificate.
|
byte[] |
getSignature()
Retrieves the signature of the certificate, including the signature algorithm.
|
java.lang.String |
getSignatureAlgorithm()
Retrieves the signature algorithm used for the signature.
|
OpenSshCertificate.Type |
getType()
Retrieves the type of certificate.
|
long |
getValidAfter()
Retrieves the time in number of seconds since the
Instant.EPOCH at which this certificate
becomes or became valid. |
long |
getValidBefore()
Retrieves the time in number of seconds since the
Instant.EPOCH at which this certificate
becomes or became invalid. |
void |
setCaPubKey(java.security.PublicKey caPubKey) |
void |
setCertPubKey(java.security.PublicKey certificatePublicKey) |
void |
setCriticalOptions(java.util.List<OpenSshCertificate.CertificateOption> criticalOptions) |
void |
setExtensions(java.util.List<OpenSshCertificate.CertificateOption> extensions) |
void |
setId(java.lang.String id) |
void |
setKeyType(java.lang.String keyType) |
void |
setMessage(byte[] message) |
void |
setNonce(byte[] nonce) |
void |
setPrincipals(java.util.Collection<java.lang.String> principals) |
void |
setReserved(java.lang.String reserved) |
void |
setSerial(long serial) |
void |
setSignature(byte[] signature) |
void |
setType(OpenSshCertificate.Type type) |
void |
setValidAfter(java.time.Instant validAfter)
If null, uses
OpenSshCertificate.MIN_EPOCH |
void |
setValidAfter(long validAfter) |
void |
setValidBefore(java.time.Instant validBefore)
If null, uses
OpenSshCertificate.INFINITY |
void |
setValidBefore(long validBefore) |
private static java.lang.String |
toDate(long timestamp) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisValidNowprivate static final long serialVersionUID
private java.lang.String keyType
private byte[] nonce
private java.security.PublicKey certificatePublicKey
private long serial
private int type
private java.lang.String id
private java.util.Collection<java.lang.String> principals
private long validAfter
private long validBefore
private java.util.List<OpenSshCertificate.CertificateOption> criticalOptions
private java.util.List<OpenSshCertificate.CertificateOption> extensions
private java.lang.String reserved
private java.security.PublicKey caPubKey
private byte[] message
private byte[] signature
public java.lang.String getRawKeyType()
OpenSshCertificategetRawKeyType in interface OpenSshCertificatepublic byte[] getNonce()
OpenSshCertificategetNonce in interface OpenSshCertificatepublic java.lang.String getKeyType()
OpenSshCertificategetKeyType in interface OpenSshCertificatepublic java.security.PublicKey getCertPubKey()
OpenSshCertificategetCertPubKey in interface OpenSshCertificatePublicKeypublic long getSerial()
OpenSshCertificategetSerial in interface OpenSshCertificatepublic OpenSshCertificate.Type getType()
OpenSshCertificategetType in interface OpenSshCertificateOpenSshCertificate.Typepublic java.lang.String getId()
OpenSshCertificategetId in interface OpenSshCertificatenull but may be empty.public java.util.Collection<java.lang.String> getPrincipals()
OpenSshCertificategetPrincipals in interface OpenSshCertificatenull but possibly emptypublic long getValidAfter()
OpenSshCertificateInstant.EPOCH at which this certificate
becomes or became valid.getValidAfter in interface OpenSshCertificateInstant.EPOCH as an unsigned 64bit valueOpenSshCertificate.isValidNow(OpenSshCertificate)public long getValidBefore()
OpenSshCertificateInstant.EPOCH at which this certificate
becomes or became invalid.getValidBefore in interface OpenSshCertificateInstant.EPOCH as an unsigned 64bit valueOpenSshCertificate.isValidNow(OpenSshCertificate)public java.util.List<OpenSshCertificate.CertificateOption> getCriticalOptions()
OpenSshCertificategetCriticalOptions in interface OpenSshCertificatenull but possibly emptypublic java.util.List<OpenSshCertificate.CertificateOption> getExtensions()
OpenSshCertificategetExtensions in interface OpenSshCertificatenull but possibly emptypublic java.lang.String getReserved()
OpenSshCertificategetReserved in interface OpenSshCertificatepublic java.security.PublicKey getCaPubKey()
OpenSshCertificategetCaPubKey in interface OpenSshCertificatePublicKeypublic byte[] getMessage()
OpenSshCertificategetMessage in interface OpenSshCertificatepublic byte[] getSignature()
OpenSshCertificategetSignature in interface OpenSshCertificateOpenSshCertificate.getRawSignature()public byte[] getRawSignature()
OpenSshCertificategetRawSignature in interface OpenSshCertificateOpenSshCertificate.getSignature()public java.lang.String getSignatureAlgorithm()
OpenSshCertificategetSignatureAlgorithm in interface OpenSshCertificatepublic java.lang.String getAlgorithm()
getAlgorithm in interface java.security.Keypublic java.lang.String getFormat()
getFormat in interface java.security.Keypublic byte[] getEncoded()
getEncoded in interface java.security.Keypublic void setKeyType(java.lang.String keyType)
public void setNonce(byte[] nonce)
public void setCertPubKey(java.security.PublicKey certificatePublicKey)
public void setSerial(long serial)
public void setType(OpenSshCertificate.Type type)
public void setId(java.lang.String id)
public void setPrincipals(java.util.Collection<java.lang.String> principals)
public void setValidAfter(long validAfter)
public void setValidAfter(java.time.Instant validAfter)
OpenSshCertificate.MIN_EPOCHvalidAfter - Instant to use for validAfterpublic void setValidBefore(long validBefore)
public void setValidBefore(java.time.Instant validBefore)
OpenSshCertificate.INFINITYvalidBefore - Instant to use for validBeforepublic void setCriticalOptions(java.util.List<OpenSshCertificate.CertificateOption> criticalOptions)
public void setExtensions(java.util.List<OpenSshCertificate.CertificateOption> extensions)
public void setReserved(java.lang.String reserved)
public void setCaPubKey(java.security.PublicKey caPubKey)
public void setMessage(byte[] message)
public void setSignature(byte[] signature)
private static java.lang.String toDate(long timestamp)
public java.lang.String toString()
toString in class java.lang.Object