public class OpenSshCertificateImpl extends Object implements OpenSshCertificate
OpenSshCertificate.CertificateOption, OpenSshCertificate.Type
INFINITY, MIN_EPOCH
Constructor and Description |
---|
OpenSshCertificateImpl() |
Modifier and Type | Method and Description |
---|---|
String |
getAlgorithm() |
PublicKey |
getCaPubKey()
Retrieves the CA public key of this certificate.
|
PublicKey |
getCertPubKey()
Retrieves the certified public key.
|
List<OpenSshCertificate.CertificateOption> |
getCriticalOptions()
Retrieves the critical options set in the certificate.
|
byte[] |
getEncoded() |
List<OpenSshCertificate.CertificateOption> |
getExtensions()
Retrieves the extensions set in the certificate.
|
String |
getFormat() |
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.
|
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.
|
Collection<String> |
getPrincipals()
Retrieves the principals mentioned in the certificate.
|
String |
getRawKeyType()
Retrieves the raw SSH key type of this certificate.
|
byte[] |
getRawSignature()
Retrieves the raw signature bytes, without the signature algorithm.
|
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.
|
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(PublicKey caPubKey) |
void |
setCertPubKey(PublicKey certificatePublicKey) |
void |
setCriticalOptions(List<OpenSshCertificate.CertificateOption> criticalOptions) |
void |
setExtensions(List<OpenSshCertificate.CertificateOption> extensions) |
void |
setId(String id) |
void |
setKeyType(String keyType) |
void |
setMessage(byte[] message) |
void |
setNonce(byte[] nonce) |
void |
setPrincipals(Collection<String> principals) |
void |
setReserved(String reserved) |
void |
setSerial(long serial) |
void |
setSignature(byte[] signature) |
void |
setType(OpenSshCertificate.Type type) |
void |
setValidAfter(Instant validAfter)
If null, uses
OpenSshCertificate.MIN_EPOCH |
void |
setValidAfter(long validAfter) |
void |
setValidBefore(Instant validBefore)
If null, uses
OpenSshCertificate.INFINITY |
void |
setValidBefore(long validBefore) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isValidNow
destroy, isDestroyed
public String getRawKeyType()
OpenSshCertificate
getRawKeyType
in interface OpenSshCertificate
public byte[] getNonce()
OpenSshCertificate
getNonce
in interface OpenSshCertificate
public String getKeyType()
OpenSshCertificate
getKeyType
in interface OpenSshCertificate
public 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 String getId()
OpenSshCertificate
getId
in interface OpenSshCertificate
null
but may be empty.public Collection<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 List<OpenSshCertificate.CertificateOption> getCriticalOptions()
OpenSshCertificate
getCriticalOptions
in interface OpenSshCertificate
null
but possibly emptypublic List<OpenSshCertificate.CertificateOption> getExtensions()
OpenSshCertificate
getExtensions
in interface OpenSshCertificate
null
but possibly emptypublic String getReserved()
OpenSshCertificate
getReserved
in interface OpenSshCertificate
public 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 String getSignatureAlgorithm()
OpenSshCertificate
getSignatureAlgorithm
in interface OpenSshCertificate
public String getAlgorithm()
getAlgorithm
in interface Key
public byte[] getEncoded()
getEncoded
in interface Key
public void setKeyType(String keyType)
public void setNonce(byte[] nonce)
public void setCertPubKey(PublicKey certificatePublicKey)
public void setSerial(long serial)
public void setType(OpenSshCertificate.Type type)
public void setId(String id)
public void setPrincipals(Collection<String> principals)
public void setValidAfter(long validAfter)
public void setValidAfter(Instant validAfter)
OpenSshCertificate.MIN_EPOCH
validAfter
- Instant
to use for validAfterpublic void setValidBefore(long validBefore)
public void setValidBefore(Instant validBefore)
OpenSshCertificate.INFINITY
validBefore
- Instant
to use for validBeforepublic void setCriticalOptions(List<OpenSshCertificate.CertificateOption> criticalOptions)
public void setExtensions(List<OpenSshCertificate.CertificateOption> extensions)
public void setReserved(String reserved)
public void setCaPubKey(PublicKey caPubKey)
public void setMessage(byte[] message)
public void setSignature(byte[] signature)
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.