Libp2pCertificateGenerator class

Generates an ephemeral self-signed X.509 certificate with the libp2p TLS extension for use in libp2p QUIC handshakes.

The generated certificate contains:

  • An ephemeral ECDSA P-256 key pair.
  • A self-signature over the TBS certificate.
  • The libp2p extension (OID 1.3.6.1.4.1.53594.1.1) embedding a SignedKey protobuf signed by the host's long-term identity key.

Per the libp2p TLS specification, the ephemeral certificate proves that the peer controlling the TLS handshake also controls the libp2p identity referenced by the extension.

Constructors

Libp2pCertificateGenerator(CryptoBackend _backend)
Creates a generator that uses backend for cryptographic operations.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

generate({required SecretKey hostIdentityPrivateKey, required List<int> hostPublicKeyBytes, DateTime? notBefore, DateTime? notAfter}) Future<CertificateChain>
Creates an ephemeral certificate chain with the libp2p extension.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited