PEM_encode

Get a string containing a PEM encoded private key, encrypting it with a password.

  1. string PEM_encode(PrivateKey key)
  2. string PEM_encode(PrivateKey key, RandomNumberGenerator rng, string pass, Duration dur, string pbe_algo)
    static if(BOTAN_HAS_PUBLIC_KEY_CRYPTO)
    string
    PEM_encode
    (,,
    in string pass
    ,
    Duration dur = 300.msecs
    ,
    in string pbe_algo = ""
    )

Parameters

key PrivateKey

the key to encode

rng RandomNumberGenerator

the rng to use

pass string

the password to use for encryption

dur Duration

number of milliseconds to run the password derivation

pbe_algo string

the name of the desired password-based encryption algorithm; if empty ("") a reasonable (portable/secure) default will be chosen.

Return Value

Type: string

encrypted key in PEM form

Meta