View Source ecies_pem (ecies v1.1.0)
Summary
Functions
Equivalent to decode_keypair(Pem, ecies:default_params()).
Equivalent to decode_private(Pem, ecies:default_params()).
Decodes the given
Pem binary representation a PEM formatted "EC PRIVATE KEY" into a PrivateKey.Decodes the given
Pem binary representation a PEM formatted "PUBLIC KEY" or "EC PRIVATE KEY" into a PublicKey.Encodes the given
KeyPair into PEM "EC PRIVATE KEY" format (public key included).Encodes the given
PrivateKey into PEM "EC PRIVATE KEY" format.Encodes the given
PublicKey into PEM "PUBLIC KEY" format.Returns a list of named curves that are supported by the
ecies_pem module.See also: pubkey_cert_records:namedCurves/1.
Checks if the given
NamedCurve is supported by the ecies_pem module.Functions
-spec decode_keypair(Pem :: binary()) -> ecies:keypair() | error.
Equivalent to decode_keypair(Pem, ecies:default_params()).
Decodes the givenPem binary representation a PEM formatted "EC PRIVATE KEY" into a key pair {PublicKey, PrivateKey}. If the public key is not included in the given Pem`, it recovers the public key from the private one using `ecies_pubkey:from_private/2. This is only possible for curves returned by ecies_pubkey:supports_from_private/0.
-spec decode_keypair(Pem :: binary(), #{return_curve := true, verify_curve => boolean(), _ => _}) -> {ecies:named_curve(), ecies:keypair()} | error; (Pem :: binary(), #{verify_curve => boolean(), _ => _}) -> ecies:keypair() | error.
Equivalent to decode_keypair(Pem, ecies:default_params()).
Decodes the givenPem binary representation a PEM formatted "EC PRIVATE KEY" into a key pair {PublicKey, PrivateKey}. If the public key is not included in the given Pem`, it recovers the public key from the private one using `ecies_pubkey:from_private/2. This is only possible for curves returned by ecies_pubkey:supports_from_private/0.
-spec decode_private(Pem :: binary()) -> ecies:private_key() | error.
Equivalent to decode_private(Pem, ecies:default_params()).
Decodes the givenPem binary representation a PEM formatted "EC PRIVATE KEY" into a PrivateKey.
-spec decode_private(Pem :: binary(), #{return_curve := true, verify_curve => boolean(), _ => _}) -> {ecies:named_curve(), ecies:private_key()} | error; (Pem :: binary(), #{verify_curve => boolean(), _ => _}) -> ecies:private_key() | error.
Pem binary representation a PEM formatted "EC PRIVATE KEY" into a PrivateKey.
-spec decode_public(Pem :: binary()) -> ecies:public_key().
Equivalent to decode_public(PemEncodedPublicKey, ecies:default_params()).
Decodes the givenPem binary representation a PEM formatted "PUBLIC KEY" or "EC PRIVATE KEY" into a PublicKey.
-spec decode_public(binary(), ecies:ecies_params()) -> ecies:public_key().
Pem binary representation a PEM formatted "PUBLIC KEY" or "EC PRIVATE KEY" into a PublicKey.
-spec encode_keypair(KeyPair :: ecies:keypair()) -> binary().
Equivalent to encode_keypair(KeyPair, ecies:default_params()).
Encodes the givenKeyPair into PEM "EC PRIVATE KEY" format (public key included).
-spec encode_keypair(ecies:keypair(), #{curve := ecies:named_curve(), _ => _}) -> binary().
KeyPair into PEM "EC PRIVATE KEY" format (public key included).
-spec encode_private(PrivateKey :: ecies:private_key()) -> binary().
Equivalent to encode_private(PrivateKey, ecies:default_params()).
Encodes the givenPrivateKey into PEM "EC PRIVATE KEY" format.
-spec encode_private(PrivateKey :: ecies:private_key(), #{curve := ecies:named_curve(), _ => _}) -> binary().
PrivateKey into PEM "EC PRIVATE KEY" format.
-spec encode_public(PublicKey :: ecies:public_key()) -> binary().
Equivalent to encode_public(PublicKey, ecies:default_params()).
Encodes the givenPublicKey into PEM "PUBLIC KEY" format.
-spec encode_public(ecies:public_key(), ecies:ecies_params()) -> binary().
PublicKey into PEM "PUBLIC KEY" format.
-spec supports() -> [ecies:named_curve()].
ecies_pem module.See also: pubkey_cert_records:namedCurves/1.
-spec supports(NamedCurve :: ecies:named_curve()) -> boolean().
NamedCurve is supported by the ecies_pem module.