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, wait
isValidNow
private 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()
OpenSshCertificate
getRawKeyType
in interface OpenSshCertificate
public byte[] getNonce()
OpenSshCertificate
getNonce
in interface OpenSshCertificate
public java.lang.String getKeyType()
OpenSshCertificate
getKeyType
in interface OpenSshCertificate
public java.security.PublicKey getCertPubKey()
OpenSshCertificate
getCertPubKey
in interface OpenSshCertificate
PublicKey
public long getSerial()
OpenSshCertificate
getSerial
in interface OpenSshCertificate
public OpenSshCertificate.Type getType()
OpenSshCertificate
getType
in interface OpenSshCertificate
OpenSshCertificate.Type
public java.lang.String getId()
OpenSshCertificate
getId
in interface OpenSshCertificate
null
but may be empty.public java.util.Collection<java.lang.String> getPrincipals()
OpenSshCertificate
getPrincipals
in interface OpenSshCertificate
null
but possibly emptypublic long getValidAfter()
OpenSshCertificate
Instant.EPOCH
at which this certificate
becomes or became valid.getValidAfter
in interface OpenSshCertificate
Instant.EPOCH
as an unsigned 64bit valueOpenSshCertificate.isValidNow(OpenSshCertificate)
public long getValidBefore()
OpenSshCertificate
Instant.EPOCH
at which this certificate
becomes or became invalid.getValidBefore
in interface OpenSshCertificate
Instant.EPOCH
as an unsigned 64bit valueOpenSshCertificate.isValidNow(OpenSshCertificate)
public java.util.List<OpenSshCertificate.CertificateOption> getCriticalOptions()
OpenSshCertificate
getCriticalOptions
in interface OpenSshCertificate
null
but possibly emptypublic java.util.List<OpenSshCertificate.CertificateOption> getExtensions()
OpenSshCertificate
getExtensions
in interface OpenSshCertificate
null
but possibly emptypublic java.lang.String getReserved()
OpenSshCertificate
getReserved
in interface OpenSshCertificate
public java.security.PublicKey getCaPubKey()
OpenSshCertificate
getCaPubKey
in interface OpenSshCertificate
PublicKey
public byte[] getMessage()
OpenSshCertificate
getMessage
in interface OpenSshCertificate
public byte[] getSignature()
OpenSshCertificate
getSignature
in interface OpenSshCertificate
OpenSshCertificate.getRawSignature()
public byte[] getRawSignature()
OpenSshCertificate
getRawSignature
in interface OpenSshCertificate
OpenSshCertificate.getSignature()
public java.lang.String getSignatureAlgorithm()
OpenSshCertificate
getSignatureAlgorithm
in interface OpenSshCertificate
public java.lang.String getAlgorithm()
getAlgorithm
in interface java.security.Key
public java.lang.String getFormat()
getFormat
in interface java.security.Key
public byte[] getEncoded()
getEncoded
in interface java.security.Key
public 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_EPOCH
validAfter
- Instant
to use for validAfterpublic void setValidBefore(long validBefore)
public void setValidBefore(java.time.Instant validBefore)
OpenSshCertificate.INFINITY
validBefore
- 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