X509Util

channels.tls.X509Util
object X509Util

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
X509Util.type

Members list

Value members

Concrete methods

def certificateToPublicIdentity(certificate: X509Certificate): PublicIdentity

Extracts the public identity (Base64 of Ed25519 Public Key) from the certificate. Also verifies that it is actually signed by public key of identity.

Extracts the public identity (Base64 of Ed25519 Public Key) from the certificate. Also verifies that it is actually signed by public key of identity.

Value parameters

certificate

The certificate to extract the subject identity from.

Attributes

Throws
java.security.cert.CertificateException

if the validation failed

def generateCustomP2PX509Certificate(privateIdentity: PrivateIdentity): X509CertificateHolder
def generateCustomP2PX509Certificate(identityKeyPair: KeyPair, certificateKeyPair: KeyPair): X509CertificateHolder

Generates a new X.509 Certificate using the certificateKeyPair that is signed using the identityKeyPair. For the subject of the generated certificate, the public key of the identityKeyPair is used as the UNIQUE_IDENTIFIER RDN. See RFC5280

Generates a new X.509 Certificate using the certificateKeyPair that is signed using the identityKeyPair. For the subject of the generated certificate, the public key of the identityKeyPair is used as the UNIQUE_IDENTIFIER RDN. See RFC5280

Note that the identityKeyPair must be an ed25519 key.

Value parameters

certificateKeyPair

The key that is used to create the certificate.

identityKeyPair

The ed25519 key that is used to sign the certificate

Attributes

Returns

The certificate alongside the newly generated Ed25519 keypair for the certificate.

Extensions

Extensions

extension (certHolder: X509CertificateHolder)
def toJavaCertificate: X509Certificate
def toPem: CertificatePem