Top Fields Constructors Methods
org.apache.sshd.common.config.keys

public Class OpenSshCertificateImpl

extends Object
implements OpenSshCertificate
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.config.keys.OpenSshCertificate, java.security.PrivateKey, javax.security.auth.Destroyable, java.security.AsymmetricKey, java.security.Key, java.io.Serializable, org.apache.sshd.common.config.keys.SshPublicKey, java.security.PublicKey
Imports
java.security.PublicKey, java.time.Instant, java.util.Collection, .Collections, .Date, .List, java.util.concurrent.TimeUnit, org.apache.sshd.common.util.GenericUtils, .NumberUtils, org.apache.sshd.common.util.buffer.ByteArrayBuffer

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private PublicKey
private PublicKey
private List<OpenSshCertificate.CertificateOption>
private List<OpenSshCertificate.CertificateOption>
private String
private String
private byte[]
private byte[]
private Collection<String>
private String
private long
private static final long
private byte[]
private int
private long
private long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getAlgorithm()

Implements java.security.Key.getAlgorithm.

Returns the standard algorithm name for this key.

public PublicKey
getCaPubKey()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getCaPubKey.

Retrieves the CA public key of this certificate.

public PublicKey
public List<OpenSshCertificate.CertificateOption>
getCriticalOptions()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getCriticalOptions.

Retrieves the critical options set in the certificate.

public byte[]
getEncoded()

Implements java.security.Key.getEncoded.

Returns the key in its primary encoding format, or null if this key does not support encoding.

public List<OpenSshCertificate.CertificateOption>
getExtensions()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getExtensions.

Retrieves the extensions set in the certificate.

public String
getFormat()

Implements java.security.Key.getFormat.

Returns the name of the primary encoding format of this key, or null if this key does not support encoding.

public String
getId()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getId.

Retrieves a free-form text set by the CA when the certificate was generated; intended to identify the identity principal in log message.

public String
public byte[]
getMessage()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getMessage.

Retrieves the raw byte content of the certificate, minus the signature.

public byte[]
getNonce()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getNonce.

Retrieves the nonce of this certificate.

public Collection<String>
getPrincipals()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getPrincipals.

Retrieves the principals mentioned in the certificate.

public String
getRawKeyType()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getRawKeyType.

Retrieves the raw SSH key type of this certificate.

public byte[]
getRawSignature()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getRawSignature.

Retrieves the raw signature bytes, without the signature algorithm.

public String
getReserved()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getReserved.

Retrieves the "reserved" field of the certificate.

public long
getSerial()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getSerial.

Retrieves the serial number of this certificate.

public byte[]
getSignature()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getSignature.

Retrieves the signature of the certificate, including the signature algorithm.

public String
getSignatureAlgorithm()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getSignatureAlgorithm.

Retrieves the signature algorithm used for the signature.

public OpenSshCertificate.Type
getType()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getType.

Retrieves the type of certificate.

public long
getValidAfter()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getValidAfter.

Retrieves the time in number of seconds since the java.time.Instant#EPOCH at which this certificate becomes or became valid.

public long
getValidBefore()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getValidBefore.

Retrieves the time in number of seconds since the java.time.Instant#EPOCH at which this certificate becomes or became invalid.

public void
public void
setCertPubKey(PublicKey certificatePublicKey)

public void
public void
public void
public void
setKeyType(String keyType)

public void
setMessage(byte[] message)

public void
setNonce(byte[] nonce)

public void
public void
setReserved(String reserved)

public void
setSerial(long serial)

public void
setSignature(byte[] signature)

public void
public void
setValidAfter(long validAfter)

public void
setValidAfter(Instant
Instant to use for validAfter
validAfter
)

If null, uses OpenSshCertificate#MIN_EPOCH

public void
setValidBefore(long validBefore)

public void
setValidBefore(Instant
Instant to use for validBefore
validBefore
)

If null, uses OpenSshCertificate#INFINITY

private static String
toDate(long timestamp)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

caPubKeyback to summary
private PublicKey caPubKey
certificatePublicKeyback to summary
private PublicKey certificatePublicKey
criticalOptionsback to summary
private List<OpenSshCertificate.CertificateOption> criticalOptions
extensionsback to summary
private List<OpenSshCertificate.CertificateOption> extensions
idback to summary
private String id
keyTypeback to summary
private String keyType
messageback to summary
private byte[] message
nonceback to summary
private byte[] nonce
principalsback to summary
private Collection<String> principals
reservedback to summary
private String reserved
serialback to summary
private long serial
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.security.PublicKey.serialVersionUID, java.security.PrivateKey.serialVersionUID.

signatureback to summary
private byte[] signature
typeback to summary
private int type
validAfterback to summary
private long validAfter
validBeforeback to summary
private long validBefore

Constructor Detail

OpenSshCertificateImplback to summary
public OpenSshCertificateImpl()

Method Detail

getAlgorithmback to summary
public String getAlgorithm()

Implements java.security.Key.getAlgorithm.

Doc from java.security.Key.getAlgorithm.

Returns the standard algorithm name for this key. For example, "DSA" would indicate that this key is a DSA key. See the key related sections (KeyFactory, KeyGenerator, KeyPairGenerator, and SecretKeyFactory) in the Java Security Standard Algorithm Names Specification for information about standard key algorithm names.

Returns:String

the name of the algorithm associated with this key.

Annotations
@Override
getCaPubKeyback to summary
public PublicKey getCaPubKey()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getCaPubKey.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getCaPubKey.

Retrieves the CA public key of this certificate.

Returns:PublicKey

the PublicKey

Annotations
@Override
getCertPubKeyback to summary
public PublicKey getCertPubKey()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getCertPubKey.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getCertPubKey.

Retrieves the certified public key.

Returns:PublicKey

the PublicKey

Annotations
@Override
getCriticalOptionsback to summary
public List<OpenSshCertificate.CertificateOption> getCriticalOptions()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getCriticalOptions.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getCriticalOptions.

Retrieves the critical options set in the certificate.

Returns:List<OpenSshCertificate.CertificateOption>

the critical options as a list, never null but possibly empty

Annotations
@Override
getEncodedback to summary
public byte[] getEncoded()

Implements java.security.Key.getEncoded.

Doc from java.security.Key.getEncoded.

Returns the key in its primary encoding format, or null if this key does not support encoding.

Returns:byte[]

the encoded key, or null if the key does not support encoding.

Annotations
@Override
getExtensionsback to summary
public List<OpenSshCertificate.CertificateOption> getExtensions()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getExtensions.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getExtensions.

Retrieves the extensions set in the certificate.

Returns:List<OpenSshCertificate.CertificateOption>

the extensions as a list, never null but possibly empty

Annotations
@Override
getFormatback to summary
public String getFormat()

Implements java.security.Key.getFormat.

Doc from java.security.Key.getFormat.

Returns the name of the primary encoding format of this key, or null if this key does not support encoding. The primary encoding format is named in terms of the appropriate ASN.1 data format, if an ASN.1 specification for this key exists. For example, the name of the ASN.1 data format for public keys is SubjectPublicKeyInfo, as defined by the X.509 standard; in this case, the returned format is "X.509". Similarly, the name of the ASN.1 data format for private keys is PrivateKeyInfo, as defined by the PKCS #8 standard; in this case, the returned format is "PKCS#8".

Returns:String

the primary encoding format of the key.

Annotations
@Override
getIdback to summary
public String getId()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getId.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getId.

Retrieves a free-form text set by the CA when the certificate was generated; intended to identify the identity principal in log message.

Returns:String

the id; never null but may be empty.

Annotations
@Override
getKeyTypeback to summary
public String getKeyType()

Implements org.apache.sshd.common.config.keys.SshPublicKey.getKeyType.

Doc from org.apache.sshd.common.config.keys.SshPublicKey.getKeyType.

Retrieves the SSH key type.

Returns:String

the SSH key type, never null.

Annotations
@Override
getMessageback to summary
public byte[] getMessage()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getMessage.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getMessage.

Retrieves the raw byte content of the certificate, minus the signature. This is the data that was signed.

Returns:byte[]

the part of the certificate raw data that was signed

Annotations
@Override
getNonceback to summary
public byte[] getNonce()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getNonce.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getNonce.

Retrieves the nonce of this certificate.

Returns:byte[]

the nonce.

Annotations
@Override
getPrincipalsback to summary
public Collection<String> getPrincipals()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getPrincipals.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getPrincipals.

Retrieves the principals mentioned in the certificate.

Returns:Collection<String>

the collection of principals, never null but possibly empty

Annotations
@Override
getRawKeyTypeback to summary
public String getRawKeyType()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getRawKeyType.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getRawKeyType.

Retrieves the raw SSH key type of this certificate.

Returns:String

the key type, for instance "ssh-rsa" for a "[email protected]" certificate

Annotations
@Override
getRawSignatureback to summary
public byte[] getRawSignature()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getRawSignature.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getRawSignature.

Retrieves the raw signature bytes, without the signature algorithm.

Returns:byte[]

the signature bytes

Annotations
@Override
getReservedback to summary
public String getReserved()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getReserved.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getReserved.

Retrieves the "reserved" field of the certificate. OpenSSH currently doesn't use it and ignores it.

Returns:String

the "reserved" field.

Annotations
@Override
getSerialback to summary
public long getSerial()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getSerial.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getSerial.

Retrieves the serial number of this certificate.

Returns:long

the serial number

Annotations
@Override
getSignatureback to summary
public byte[] getSignature()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getSignature.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getSignature.

Retrieves the signature of the certificate, including the signature algorithm.

Returns:byte[]

the signature bytes

Annotations
@Override
getSignatureAlgorithmback to summary
public String getSignatureAlgorithm()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getSignatureAlgorithm.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getSignatureAlgorithm.

Retrieves the signature algorithm used for the signature.

Returns:String

the signature algorithm as recorded in the certificate

Annotations
@Override
getTypeback to summary
public OpenSshCertificate.Type getType()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getType.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getType.

Retrieves the type of certificate.

Returns:OpenSshCertificate.Type

the Type

Annotations
@Override
getValidAfterback to summary
public long getValidAfter()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getValidAfter.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getValidAfter.

Retrieves the time in number of seconds since the java.time.Instant#EPOCH at which this certificate becomes or became valid.

Returns:long

the number of seconds since the java.time.Instant#EPOCH as an unsigned 64bit value

Annotations
@Override
getValidBeforeback to summary
public long getValidBefore()

Implements org.apache.sshd.common.config.keys.OpenSshCertificate.getValidBefore.

Doc from org.apache.sshd.common.config.keys.OpenSshCertificate.getValidBefore.

Retrieves the time in number of seconds since the java.time.Instant#EPOCH at which this certificate becomes or became invalid.

Returns:long

the number of seconds since the java.time.Instant#EPOCH as an unsigned 64bit value

Annotations
@Override
setCaPubKeyback to summary
public void setCaPubKey(PublicKey caPubKey)
setCertPubKeyback to summary
public void setCertPubKey(PublicKey certificatePublicKey)
setCriticalOptionsback to summary
public void setCriticalOptions(List<OpenSshCertificate.CertificateOption> criticalOptions)
setExtensionsback to summary
public void setExtensions(List<OpenSshCertificate.CertificateOption> extensions)
setIdback to summary
public void setId(String id)
setKeyTypeback to summary
public void setKeyType(String keyType)
setMessageback to summary
public void setMessage(byte[] message)
setNonceback to summary
public void setNonce(byte[] nonce)
setPrincipalsback to summary
public void setPrincipals(Collection<String> principals)
setReservedback to summary
public void setReserved(String reserved)
setSerialback to summary
public void setSerial(long serial)
setSignatureback to summary
public void setSignature(byte[] signature)
setTypeback to summary
public void setType(OpenSshCertificate.Type type)
setValidAfterback to summary
public void setValidAfter(long validAfter)
setValidAfterback to summary
public void setValidAfter(Instant validAfter)

If null, uses OpenSshCertificate#MIN_EPOCH

Parameters
validAfter:Instant

Instant to use for validAfter

setValidBeforeback to summary
public void setValidBefore(long validBefore)
setValidBeforeback to summary
public void setValidBefore(Instant validBefore)

If null, uses OpenSshCertificate#INFINITY

Parameters
validBefore:Instant

Instant to use for validBefore

toDateback to summary
private static String toDate(long timestamp)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override