TimestampMixin mixin

RFC 3161 time-stamping: requesting, issuing and verifying tokens.

Client side:

final request = openssl.buildTimestampRequest(hash: sha256OfTheSignature);
final answer = await postToTsa(request.der);          // your HTTP call
final response = openssl.parseTimestampResponse(answer);

final check = openssl.verifyTimestamp(
  responseDer: answer,
  hash: sha256OfTheSignature,
  nonce: request.nonce,
  anchors: [tsaRootCa],
);

Server side (an internal TSA, signing with a certificate that carries extendedKeyUsage = critical, timeStamping):

final response = openssl.createTimestampResponse(
  requestDer: incomingRequest,
  signerCertificate: tsaCertificate,
  signerKey: tsaKey,
  defaultPolicyOid: '1.3.6.1.4.1.99999.1.1',
  serialNumber: nextSerialFromTheDatabase,
);
Superclass constraints
Mixin applications

Properties

bindings → OpenSslFfi
Acesso aos bindings brutos gerados.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
loader → OpenSslBindings
Acesso ao loader/configuração (opcional, se precisarmos de caminhos).
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildTimestampRequest({required Uint8List hash, String hashAlgorithm = 'SHA256', String? policyOid, bool requestCertificate = true, bool useNonce = true, BigInt? nonce}) → TimestampRequest
Builds a TimeStampReq for hash.
buildTimestampRequestForData(Uint8List data, {String hashAlgorithm = 'SHA256', String? policyOid, bool requestCertificate = true}) → TimestampRequest
Convenience for the common case: hash data, ask the TSA and return the request to post.
createTimestampResponse({required Uint8List requestDer, required X509Certificate signerCertificate, required EvpPkey signerKey, required String defaultPolicyOid, BigInt? serialNumber, List<String> acceptedDigests = const ['SHA256', 'SHA384', 'SHA512'], List<String> acceptedPolicyOids = const [], List<X509Certificate> chain = const [], TimestampAccuracy? accuracy, int clockPrecisionDigits = 0, bool ordering = false, String signerDigest = 'SHA256'}) → Uint8List
Issues a TimeStampResp for requestDer — the TSA side of RFC 3161.
lookup<T extends Function>(String name) → Pointer<NativeFunction<T>>
Helper para pegar endereços de funções (para NativeFinalizer).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseTimestampResponse(Uint8List der) → TimestampResponse
Parses a TimeStampResp returned by a TSA.
parseTimestampToken(Uint8List tokenDer) → TimestampToken
Parses a bare token (the CMS/PKCS#7 TimeStampToken), without the response envelope — the shape usually archived next to a signature.
toString() → String
A string representation of this object.
inherited
verifyTimestamp({Uint8List? responseDer, Uint8List? tokenDer, required Uint8List hash, required List<X509Certificate> anchors, String hashAlgorithm = 'SHA256', BigInt? nonce, String? policyOid, List<X509Certificate> intermediates = const [], bool checkSignerName = false}) → TimestampVerification
Verifies a time-stamp token against hash and a set of trust anchors.

Operators

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