apoc v0.1.2 Apoc.RSA.PublicKey View Source
Struct and set of functions for working with an RSA public key
For information on key formats in PKI see PKI PEM overview or RFC5912
See also Erlang Public Key Records
Link to this section Summary
Functions
Decrypts a message with the given public key (uses standard PKCS1 padding as decryption using the public key is not sensitive)
Dumps a key into PEM format
Encrypts a message with the given public key (uses PKCS1-OAEP padding)
Loads a pem encoded public key certificate string
Link to this section Types
Link to this section Functions
Link to this function
decrypt(key, ciphertext)
View Source
decrypt(Apoc.RSA.PublicKey.t(), binary()) :: {:ok, binary()} | :error
Decrypts a message with the given public key (uses standard PKCS1 padding as decryption using the public key is not sensitive).
Link to this function
dump_pem(public_key)
View Source
dump_pem(Apoc.RSA.PublicKey.t()) :: String.t()
Dumps a key into PEM format
Link to this function
encrypt(key, message)
View Source
encrypt(Apoc.RSA.PublicKey.t(), binary()) :: {:ok, binary()} | :error
Encrypts a message with the given public key (uses PKCS1-OAEP padding).
Link to this function
load_pem(pem_str)
View Source
load_pem(String.t()) :: {:ok, Apoc.RSA.PublicKey.t()} | {:error, String.t()}
Loads a pem encoded public key certificate string.