cardano-cli
Safe HaskellNone
LanguageHaskell2010

Cardano.CLI.Types.Key

Description

Shelley CLI option data types and functions for cryptographic keys.

Synopsis

Documentation

data VerificationKeyOrFile keyrole Source #

Either a verification key or path to a verification key file.

Constructors

VerificationKeyValue !(VerificationKey keyrole)

A verification key.

VerificationKeyFilePath !(VerificationKeyFile 'In)

A path to a verification key file. Note that this file hasn't been validated at all (whether it exists, contains a key of the correct type, etc.)

Instances

Instances details
Show (VerificationKey keyrole) => Show (VerificationKeyOrFile keyrole) Source # 
Instance details

Defined in Cardano.CLI.Types.Key

Eq (VerificationKey keyrole) => Eq (VerificationKeyOrFile keyrole) Source # 
Instance details

Defined in Cardano.CLI.Types.Key

readVerificationKeyOrFile :: forall t (m :: Type -> Type) keyrole. (MonadIOTransError (FileError InputDecodeError) t m, HasTextEnvelope (VerificationKey keyrole), SerialiseAsBech32 (VerificationKey keyrole)) => AsType keyrole -> VerificationKeyOrFile keyrole -> t m (VerificationKey keyrole) Source #

Read a verification key or verification key file and return a verification key.

If a filepath is provided, the file can either be formatted as Bech32, hex, or text envelope.

readVerificationKeyOrTextEnvFile :: forall t (m :: Type -> Type) keyrole. (MonadIOTransError (FileError InputDecodeError) t m, HasTextEnvelope (VerificationKey keyrole)) => AsType keyrole -> VerificationKeyOrFile keyrole -> t m (VerificationKey keyrole) Source #

Read a verification key or verification key file and return a verification key.

If a filepath is provided, it will be interpreted as a text envelope formatted file.

readVerificationKeyTextOrFileAnyOf :: VerificationKeyTextOrFile -> IO (Either VerificationKeyTextOrFileError SomeAddressVerificationKey) Source #

Deserialise a verification key from text or a verification key file. If a filepath is provided, the file can either be formatted as Bech32, hex, or text envelope.

data VerificationKeyOrHashOrFile keyrole Source #

Verification key, verification key hash, or path to a verification key file.

Constructors

VerificationKeyOrFile !(VerificationKeyOrFile keyrole)

Either a verification key or path to a verification key file.

VerificationKeyHash !(Hash keyrole)

A verification key hash.

Instances

Instances details
(Show (VerificationKeyOrFile keyrole), Show (Hash keyrole)) => Show (VerificationKeyOrHashOrFile keyrole) Source # 
Instance details

Defined in Cardano.CLI.Types.Key

(Eq (VerificationKeyOrFile keyrole), Eq (Hash keyrole)) => Eq (VerificationKeyOrHashOrFile keyrole) Source # 
Instance details

Defined in Cardano.CLI.Types.Key

readVerificationKeyOrHashOrFile :: forall t (m :: Type -> Type) keyrole. (MonadIOTransError (FileError InputDecodeError) t m, Key keyrole, SerialiseAsBech32 (VerificationKey keyrole)) => AsType keyrole -> VerificationKeyOrHashOrFile keyrole -> t m (Hash keyrole) Source #

Read a verification key or verification key hash or verification key file and return a verification key hash.

If a filepath is provided, the file can either be formatted as Bech32, hex, or text envelope.

readVerificationKeyOrHashOrTextEnvFile :: forall t (m :: Type -> Type) keyrole. (MonadIOTransError (FileError InputDecodeError) t m, Key keyrole) => AsType keyrole -> VerificationKeyOrHashOrFile keyrole -> t m (Hash keyrole) Source #

Read a verification key or verification key hash or verification key file and return a verification key hash.

If a filepath is provided, it will be interpreted as a text envelope formatted file.

generateKeyPair :: (MonadIO m, Key keyrole, HasTypeProxy keyrole) => AsType keyrole -> m (VerificationKey keyrole, SigningKey keyrole) Source #

data AnyDelegationTarget where Source #

A resource that identifies the delegation target. We can delegate our stake for two reasons: 1. To gain rewards. This is limited to choosing a stake pool 2. To delegate voting power. We can delegate this to a DRep, always abstain our vote or vote no confidence

data ColdVerificationKeyOrFile Source #

Either a stake pool verification key, genesis delegate verification key, or a path to a cold verification key file.

Note that a "cold verification key" refers to either a stake pool or genesis delegate verification key.

TODO: A genesis delegate extended key should also be valid here.

withSomeSigningKey :: SomeSigningKey -> (forall keyrole. (Key keyrole, HasTypeProxy keyrole) => SigningKey keyrole -> a) -> a Source #