• Create certificate name from subject name, key name, or certificate name.

    Parameters

    • name: Name

      Subject name, key name, or certificate name.

    • opts: Partial<Pick<CertNameFields, "keyId" | "issuerId" | "version">> = {}

    Returns Name

    Remarks

    If name is a subject name, it's concatenated with additional components to make a certificate name:

    • KeyId component is set to .opts.keyId. If unset, it defaults to the current timestamp.

    If name is a key name, it's concatenated with additional components to make a certificate name:

    • KeyId component is set to .opts.keyId. If unset, it defaults to TimestampNameComponent of the current timestamp.
    • IssuerId component is set to .opts.issuerId. If unset, it defaults to "NDNts".
    • Version component is set to .opts.version. If unset, it defaults to VersionNameComponent of the current timestamp in milliseconds.

    If name is a certificate name, it is returned unchanged.