BSV v0.1.0-dev.2 BSV.Crypto.RSA.PrivateKey View Source
RSA Private Key module.
Link to this section Summary
Functions
Converts the given RSA private key struct to an Erlang private key raw list.
Converts the given RSA private key struct to an Erlang private key sequence.
Converts the given Erlang private key raw list to a RSA private key struct.
Converts the given Erlang private key sequence to a RSA private key struct.
Returns the public key from the given RSA private key.
Link to this section Types
Erlang RSA Private Key raw binary list
Erlang RSA Private Key sequence
RSA Private Key
Link to this section Functions
as_raw(private_key)
View Sourceas_raw(BSV.Crypto.RSA.PrivateKey.t()) :: BSV.Crypto.RSA.PrivateKey.raw_key()
Converts the given RSA private key struct to an Erlang private key raw list.
as_sequence(private_key)
View Sourceas_sequence(BSV.Crypto.RSA.PrivateKey.t()) :: BSV.Crypto.RSA.PrivateKey.sequence()
Converts the given RSA private key struct to an Erlang private key sequence.
Examples
iex> private_key = BSV.Crypto.RSA.PrivateKey.from_sequence(BSV.Test.rsa_key)
...>
...> BSV.Crypto.RSA.PrivateKey.as_sequence(private_key)
...> |> is_tuple
true
from_raw(list)
View Sourcefrom_raw(BSV.Crypto.RSA.PrivateKey.raw_key()) :: BSV.Crypto.RSA.PrivateKey.t()
Converts the given Erlang private key raw list to a RSA private key struct.
from_sequence(rsa_key_sequence)
View Sourcefrom_sequence(BSV.Crypto.RSA.PrivateKey.sequence()) :: BSV.Crypto.RSA.PrivateKey.t()
Converts the given Erlang private key sequence to a RSA private key struct.
Examples
iex> private_key = BSV.Crypto.RSA.PrivateKey.from_sequence(BSV.Test.rsa_key)
...> private_key.__struct__ == BSV.Crypto.RSA.PrivateKey
true
get_public_key(private_key)
View Sourceget_public_key(BSV.Crypto.RSA.PrivateKey.t()) :: BSV.Crypto.RSA.PublicKey.t()
Returns the public key from the given RSA private key.
Examples
iex> public_key = BSV.Crypto.RSA.PrivateKey.from_sequence(BSV.Test.rsa_key)
...> |> BSV.Crypto.RSA.PrivateKey.get_public_key
...> public_key.__struct__ == BSV.Crypto.RSA.PublicKey
true