Function certtoIssuerSerialHex

  • get IssuerSerial hexadecimal value from certificate PEM

    Parameters

    • certPEM: string

      PEM certificate

    Returns string

    hexadecimal string of ASN.1 IssuerSerial of certificate

    Description

    This function will return a hexadecimal string of IssuerSerial of the certificate.

    IssuerSerial ::= SEQUENCE {
    issuer GeneralNames,
    serialNumber CertificateSerialNumber }

    Here is a ASN.1 dump of an hexadecimal string output of this function.

    SEQUENCE {
    SEQUENCE {
    [4] {
    SEQUENCE {
    SET {
    SEQUENCE {
    OBJECT IDENTIFIER countryName (2 5 4 6)
    PrintableString 'JP'
    }
    }
    SET {
    SEQUENCE {
    OBJECT IDENTIFIER organizationName (2 5 4 10)
    UTF8String 'T-P256-ES-256'
    }
    }
    }
    }
    }
    INTEGER 1
    }

    Since

    0.2.0

    See

    RFC5035 Section 4. IssuerSerial

    Example

    certtoIssuerSerialHex("-----BEGIN CERT...") -> "302531..."