BSV-ex v0.2.2 BSV.Crypto.RSA.PrivateKey View Source

RSA Private Key module.

Link to this section Summary

Types

Erlang RSA Private Key raw binary list

Erlang RSA Private Key sequence

t()

RSA Private Key

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

Link to this type

raw_key()

View Source
raw_key() :: [binary()]

Erlang RSA Private Key raw binary list

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 raw list.

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 raw list to a RSA private key struct.

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

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