hammerspoon2-docs
    Preparing search index...

    Function importIdentity

    • Store a certificate and its private key (an identity) from a PKCS#12 (.p12) file, replacing any certificates already stored under the same name. Once stored, the private key can be used for TLS, but can't be read back out. The file can be deleted afterwards.

      A PKCS#12 file can be exported from Keychain Access, or made from a certificate and key with openssl pkcs12 -export -in cert.pem -inkey key.pem -out identity.p12.

      Parameters

      • name: string

        The name to store it under, which is how other modules find it. Can't be empty.

      • path: string

        The path of the PKCS#12 file

      • Optionalpassphrase: string | null

        The file's passphrase, if it has one

      Returns void

      Throws an Error on failure; wrap calls in try/catch to handle it.