BSV v0.1.0-dev.1 BSV.Crypto.RSA.PublicKey View Source

RSA Public Key module.

Link to this section Summary

Types

Erlang RSA Public Key sequence

t()

RSA Public Key

Functions

Converts the given RSA public key struct to an Erlang public key sequence.=

Converts the given Erlang public key sequence to a RSA public key struct.

Link to this section Types

Link to this type

sequence()

View Source
sequence() :: {:RSAPublicKey, integer(), integer()}

Erlang RSA Public Key sequence

Link to this type

t()

View Source
t() :: %BSV.Crypto.RSA.PublicKey{modulus: integer(), public_exponent: integer()}

RSA Public Key

Link to this section Functions

Converts the given RSA public key struct to an Erlang public key sequence.=

Examples

iex> public_key = BSV.Crypto.RSA.PrivateKey.from_sequence(BSV.Test.rsa_key)
...> |> BSV.Crypto.RSA.PrivateKey.get_public_key
...>
...> BSV.Crypto.RSA.PublicKey.as_sequence(public_key)
...> |> is_tuple
true

Converts the given Erlang public key sequence to a RSA public key struct.

Examples

iex> public_key_sequence = BSV.Crypto.RSA.PrivateKey.from_sequence(BSV.Test.rsa_key)
...> |> BSV.Crypto.RSA.PrivateKey.get_public_key
...> |> BSV.Crypto.RSA.PublicKey.as_sequence
...>
...> public_key = BSV.Crypto.RSA.PublicKey.from_sequence(public_key_sequence)
...> (%BSV.Crypto.RSA.PublicKey{} = public_key) == public_key
true