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

RSA Private Key module.

Link to this section Summary

Types

Erlang RSA Private Key sequence

t()

RSA Private Key

Functions

Converts the given RSA private key struct to an Erlang private key sequence.

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

Link to this type

sequence()

View Source
sequence() ::
  {:RSAPrivateKey, atom(), integer(), integer(), integer(), integer(),
   integer(), integer(), integer(), integer(), atom() | tuple()}

Erlang RSA Private Key sequence

Link to this type

t()

View Source
t() :: %BSV.Crypto.RSA.PrivateKey{
  coefficient: integer(),
  exponent_1: integer(),
  exponent_2: integer(),
  modulus: integer(),
  other_prime_info: atom() | tuple(),
  prime_1: integer(),
  prime_2: integer(),
  private_exponent: integer(),
  public_exponent: integer(),
  version: atom()
}

RSA Private Key

Link to this section Functions

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

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)
...> (%BSV.Crypto.RSA.PrivateKey{} = private_key) == private_key
true

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
...> (%BSV.Crypto.RSA.PublicKey{} = public_key) == public_key
true