Utility functions to import/export keys and other stuff to PEM format
Utility functions to import/export keys and other stuff to PEM format
(encrypted-pem->private-key private-key-pem password)
Convert encrypted PEM (PKCS#8) string to ECGOST3410-2012 private key.
PEM will be decrypted with password
.
Convert encrypted PEM (PKCS#8) string to ECGOST3410-2012 private key. PEM will be decrypted with `password`.
(encrypted-pem->secret-key encrypted-pem-secret-key password)
(encrypted-pem->secret-key encrypted-pem-secret-key password algo-name)
Convert encrypted PEM (PKCS#8) string to SecretKey.
algo-name
- allowed values "GOST28147" or "GOST3412-2015" (default)Convert encrypted PEM (PKCS#8) string to SecretKey. * `algo-name` - allowed values "GOST28147" or "GOST3412-2015" (default)
(pem->private-key pem-key)
Convert PEM (PKCS#8) string to a private key ECGOST3410-2012. PEM private key is unencrypted!
Convert PEM (PKCS#8) string to a private key ECGOST3410-2012. PEM private key is unencrypted!
(pem->public-key pem-key)
Convert PEM public key string to a public key ECGOST3410-2012
Convert PEM public key string to a public key ECGOST3410-2012
(pem->secret-key pem-secret-key)
(pem->secret-key pem-secret-key algo-name)
Convert plain PEM (PKCS#8) string to SecretKey.
algo-name
- allowed values "GOST28147" or "GOST3412-2015" (default)Convert plain PEM (PKCS#8) string to SecretKey. * `algo-name` - allowed values "GOST28147" or "GOST3412-2015" (default)
(private-key->encrypted-pem private-key password)
Convert ECGOST3410-2012 private key to encrypted PEM (PKCS#8) string.
Private key will be encrypted with password
using AES256-CBC.
Convert ECGOST3410-2012 private key to encrypted PEM (PKCS#8) string. Private key will be encrypted with `password` using AES256-CBC.
(private-key->pem private-key)
Convert ECGOST3410-2012 private key to PEM (PKCS#8) string. Private key is unencrypted!
Convert ECGOST3410-2012 private key to PEM (PKCS#8) string. Private key is unencrypted!
(public-key->pem public-key)
Convert ECGOST3410-2012 public key to PEM public key string
Convert ECGOST3410-2012 public key to PEM public key string
(read-bytes-from-pem pem-data)
Reads arbitrary byte array from PEM string. Returns byte array.
Reads arbitrary byte array from PEM string. Returns byte array.
(read-struct-from-pem pem-data)
Reads structured data from PEM string. Returns {:data ^bytes :headers ^map :type ^String}.
Reads structured data from PEM string. Returns {:data ^bytes :headers ^map :type ^String}.
(secret-key->encrypted-pem secret-key password)
Convert secret key to encrypted PEM (PKCS#8) string.
Secret key will be encrypted with key derived from PBKDF2(password
) using GOST3412-2015-CBC
Convert secret key to encrypted PEM (PKCS#8) string. Secret key will be encrypted with key derived from PBKDF2(`password`) using GOST3412-2015-CBC
(secret-key->pem secret-key)
Convert secret key to PEM (PKCS#8) string. Secret key is unencrypted!
Convert secret key to PEM (PKCS#8) string. Secret key is unencrypted!
(write-bytes-to-pem type data)
Writes arbitrary byte array to PEM string.
type
- type of data
which will be in divider before and after PEM content.data
- any byte arrayWrites arbitrary byte array to PEM string. * `type` - type of `data` which will be in divider before and after PEM content. * `data` - any byte array
(write-struct-to-pem {:keys [data headers type]})
Writes structured data to PEM string. {:data ^bytes :headers ^map :type ^String}
Writes structured data to PEM string. {:data ^bytes :headers ^map :type ^String}
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close