| Copyright | Aleksandr Krupenkin 2016-2024 |
|---|---|
| License | Apache-2.0 |
| Maintainer | mail@akru.me |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Network.Polkadot.Crypto
Description
Polkadot signing types and methods.
Synopsis
- class Pair a where
- class Verify a where
- verify :: (IdentifyAccount s, ByteArrayAccess ba) => a -> ba -> s -> Bool
- class Pair a => MultiPair a where
- type MultiAddress a
- type MultiSigner a
- type MultiSignature a
- multi_address :: a -> MultiAddress a
- multi_signer :: a -> MultiSigner a
- multi_sign :: ByteArrayAccess ba => a -> ba -> MultiSignature a
- data Ed25519
- data Ecdsa
Documentation
Class suitable for typical cryptographic PKI key pair type.
Associated Types
The type which is used to encode a public key.
The type used to represent a signature. Can be created from a key pair and a message and verified with the message and a public key.
Methods
Generate new secure (random) key pair.
from_seed :: ByteArrayAccess ba => ba -> Either String a Source #
Generate new key pair from the provided seed.
from_phrase :: Text -> Maybe Text -> Either String a Source #
Generate key pair from given recovery phrase and password.
public :: a -> PublicKey a Source #
Get a public key.
sign :: ByteArrayAccess ba => a -> ba -> Signature a Source #
Sign a message.
Instances
| Pair Ecdsa Source # | |
Defined in Network.Polkadot.Crypto | |
| Pair Ed25519 Source # | |
Defined in Network.Polkadot.Crypto | |
Means of signature verification.
Methods
Arguments
| :: (IdentifyAccount s, ByteArrayAccess ba) | |
| => a | Message signature. |
| -> ba | Message content. |
| -> s | Type of the signer. |
| -> Bool | Returns |
Verify a message.
class Pair a => MultiPair a where Source #
Multiple cryptographic type support.
Associated Types
type MultiAddress a Source #
Universal short representation of signer account.
type MultiSigner a Source #
Universal signer account identifier.
type MultiSignature a Source #
Universal signature representation.
Methods
multi_address :: a -> MultiAddress a Source #
Derive universal account address.
multi_signer :: a -> MultiSigner a Source #
Derive universal signer account identifier.
multi_sign :: ByteArrayAccess ba => a -> ba -> MultiSignature a Source #
Sign message and derive universal signature.
Instances
| MultiPair Ecdsa Source # | |
Defined in Network.Polkadot.Crypto Associated Types type MultiAddress Ecdsa Source # type MultiSigner Ecdsa Source # type MultiSignature Ecdsa Source # Methods multi_address :: Ecdsa -> MultiAddress Ecdsa Source # multi_signer :: Ecdsa -> MultiSigner Ecdsa Source # multi_sign :: ByteArrayAccess ba => Ecdsa -> ba -> MultiSignature Ecdsa Source # | |
| MultiPair Ed25519 Source # | |
Defined in Network.Polkadot.Crypto Associated Types type MultiAddress Ed25519 Source # type MultiSigner Ed25519 Source # type MultiSignature Ed25519 Source # Methods multi_address :: Ed25519 -> MultiAddress Ed25519 Source # multi_signer :: Ed25519 -> MultiSigner Ed25519 Source # multi_sign :: ByteArrayAccess ba => Ed25519 -> ba -> MultiSignature Ed25519 Source # | |
Ed25519 cryptographic pair.
Instances
| Show Ed25519 Source # | |
| Eq Ed25519 Source # | |
| MultiPair Ed25519 Source # | |
Defined in Network.Polkadot.Crypto Associated Types type MultiAddress Ed25519 Source # type MultiSigner Ed25519 Source # type MultiSignature Ed25519 Source # Methods multi_address :: Ed25519 -> MultiAddress Ed25519 Source # multi_signer :: Ed25519 -> MultiSigner Ed25519 Source # multi_sign :: ByteArrayAccess ba => Ed25519 -> ba -> MultiSignature Ed25519 Source # | |
| Pair Ed25519 Source # | |
Defined in Network.Polkadot.Crypto | |
| type MultiAddress Ed25519 Source # | |
Defined in Network.Polkadot.Crypto | |
| type MultiSignature Ed25519 Source # | |
Defined in Network.Polkadot.Crypto | |
| type MultiSigner Ed25519 Source # | |
Defined in Network.Polkadot.Crypto | |
| type PublicKey Ed25519 Source # | |
Defined in Network.Polkadot.Crypto | |
| type Signature Ed25519 Source # | |
Defined in Network.Polkadot.Crypto | |
ECDSA cryptographic pair.
Instances
| Show Ecdsa Source # | |
| Eq Ecdsa Source # | |
| MultiPair Ecdsa Source # | |
Defined in Network.Polkadot.Crypto Associated Types type MultiAddress Ecdsa Source # type MultiSigner Ecdsa Source # type MultiSignature Ecdsa Source # Methods multi_address :: Ecdsa -> MultiAddress Ecdsa Source # multi_signer :: Ecdsa -> MultiSigner Ecdsa Source # multi_sign :: ByteArrayAccess ba => Ecdsa -> ba -> MultiSignature Ecdsa Source # | |
| Pair Ecdsa Source # | |
Defined in Network.Polkadot.Crypto | |
| type MultiAddress Ecdsa Source # | |
Defined in Network.Polkadot.Crypto | |
| type MultiSignature Ecdsa Source # | |
Defined in Network.Polkadot.Crypto | |
| type MultiSigner Ecdsa Source # | |
Defined in Network.Polkadot.Crypto | |
| type PublicKey Ecdsa Source # | |
Defined in Network.Polkadot.Crypto | |
| type Signature Ecdsa Source # | |
Defined in Network.Polkadot.Crypto | |