Class TrustedCertificateService

This class allows for managing trusted certificates.

Hierarchy (view full)

Constructors

Methods

  • Regenerates unsigned verification code for trusted certificate.

    Parameters

    Returns Promise<IResult<ITrustedCertificate>>

    Certificate object with new verification code (wrapped in [[IResult]])

    Example


    (async () => {
    const fingerPrint = '00a360973e3e8d61e05aedb32c72438e2442279e';
    const {data, res} = await trustedCertificateService.regeneratePoPVerificationCode(fingerPrint);
    const newProofOfPossessionUnsignedVerificationCode = data.proofOfPossessionUnsignedVerificationCode;
    })();
  • Verifies signed verification code for trusted certificate.

    Parameters

    • entityOrId: string | ITrustedCertificate

      Trusted certificate object or finger print.

    • proofOfPossessionSignedVerificationCode: string

      Unsigned verification code encrypted by the private key.

    Returns Promise<IResult<ITrustedCertificate>>

    Certificate object with the result of verification (wrapped in [[IResult]]).

    Example


    (async () => {
    const fingerPrint = '00a360973e3e8d61e05aedb32c72438e2442279e';
    const encryptedVerificationCode ='fuvlVWLfXG3V3bJWAdEhPD0HFCrYo5';
    const {data, res} = await trustedCertificateService.verifySignedVerificationCode(fingerPrint, encryptedVerificationCode);
    const isCertificateVerified = data.proofOfPossessionValid;
    })();