Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- class ToShelleyWitnessSigningKey a where
- data GYSigningKey (kr ∷ GYKeyRole)
- signingKeyToLedger ∷ GYSigningKey kr → SignKeyDSIGN StandardCrypto
- signingKeyFromLedger ∷ SignKeyDSIGN StandardCrypto → GYSigningKey kr
- signingKeyToRawBytes ∷ GYSigningKey kr → ByteString
- signingKeyToRawBytesHex ∷ GYSigningKey kr → ByteString
- signingKeyToRawBytesHexText ∷ GYSigningKey kr → Text
- signingKeyFromRawBytes ∷ ByteString → Maybe (GYSigningKey kr)
- signingKeyFromRawBytesHex ∷ ByteString → Either String (GYSigningKey kr)
- type family GYSigningKeyToApi (kr ∷ GYKeyRole) where ...
- signingKeyToApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYSigningKey kr → GYSigningKeyToApi kr
- signingKeyFromApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYSigningKeyToApi kr → GYSigningKey kr
- generateSigningKey ∷ ∀ kr. SingGYKeyRoleI kr ⇒ IO (GYSigningKey kr)
- writeSigningKey ∷ ∀ kr. (SingGYKeyRoleI kr, HasTextEnvelope (GYSigningKeyToApi kr)) ⇒ FilePath → GYSigningKey kr → IO ()
- readSigningKey ∷ ∀ kr. (SingGYKeyRoleI kr, HasTextEnvelope (GYSigningKeyToApi kr)) ⇒ FilePath → IO (GYSigningKey kr)
- signingKeyToLedgerKeyPair ∷ GYSigningKey kr → KeyPair (GYKeyRoleToLedger kr) StandardCrypto
- signingKeyFromLedgerKeyPair ∷ KeyPair (GYKeyRoleToLedger kr) StandardCrypto → GYSigningKey kr
- data GYVerificationKey (kr ∷ GYKeyRole)
- verificationKeyToLedger ∷ GYVerificationKey kr → VKey (GYKeyRoleToLedger kr) StandardCrypto
- verificationKeyFromLedger ∷ VKey (GYKeyRoleToLedger kr) StandardCrypto → GYVerificationKey kr
- getVerificationKey ∷ GYSigningKey kr → GYVerificationKey kr
- verificationKeyHash ∷ GYVerificationKey kr → GYKeyHash kr
- verificationKeyToRawBytes ∷ GYVerificationKey kr → ByteString
- verificationKeyToRawBytesHex ∷ GYVerificationKey kr → ByteString
- verificationKeyToRawBytesHexText ∷ GYVerificationKey kr → Text
- verificationKeyFromRawBytes ∷ ByteString → Maybe (GYVerificationKey kr)
- verificationKeyFromRawBytesHex ∷ ByteString → Either String (GYVerificationKey kr)
- type family GYVerificationKeyToApi (kr ∷ GYKeyRole) where ...
- verificationKeyToApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYVerificationKey kr → GYVerificationKeyToApi kr
- verificationKeyFromApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYVerificationKeyToApi kr → GYVerificationKey kr
- data GYExtendedSigningKey (kr ∷ GYKeyRole)
- extendedSigningKeyToRawBytes ∷ GYExtendedSigningKey kr → ByteString
- extendedSigningKeyToRawBytesHex ∷ GYExtendedSigningKey kr → ByteString
- extendedSigningKeyToRawBytesHexText ∷ GYExtendedSigningKey kr → Text
- extendedSigningKeyFromRawBytes ∷ ByteString → Maybe (GYExtendedSigningKey kr)
- extendedSigningKeyFromRawBytesHex ∷ ByteString → Either String (GYExtendedSigningKey kr)
- type family GYExtendedSigningKeyToApi (kr ∷ GYKeyRole) where ...
- extendedSigningKeyToApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYExtendedSigningKey kr → GYExtendedSigningKeyToApi kr
- extendedSigningKeyFromApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYExtendedSigningKeyToApi kr → GYExtendedSigningKey kr
- writeExtendedSigningKey ∷ ∀ kr. (SingGYKeyRoleI kr, HasTextEnvelope (GYExtendedSigningKeyToApi kr)) ⇒ FilePath → GYExtendedSigningKey kr → IO ()
- readExtendedSigningKey ∷ ∀ kr. (SingGYKeyRoleI kr, HasTextEnvelope (GYExtendedSigningKeyToApi kr)) ⇒ FilePath → IO (GYExtendedSigningKey kr)
- type GYPaymentVerificationKey = GYVerificationKey 'GYKeyRolePayment
- paymentVerificationKeyFromApi ∷ VerificationKey PaymentKey → GYPaymentVerificationKey
- paymentVerificationKeyToApi ∷ GYPaymentVerificationKey → VerificationKey PaymentKey
- paymentVerificationKeyToLedger ∷ GYPaymentVerificationKey → VKey Payment StandardCrypto
- paymentVerificationKeyRawBytes ∷ GYPaymentVerificationKey → ByteString
- pubKeyHash ∷ GYPaymentVerificationKey → GYPubKeyHash
- paymentKeyHash ∷ GYPaymentVerificationKey → GYPaymentKeyHash
- type GYPaymentSigningKey = GYSigningKey 'GYKeyRolePayment
- type GYExtendedPaymentSigningKey = GYExtendedSigningKey 'GYKeyRolePayment
- paymentSigningKeyFromApi ∷ SigningKey PaymentKey → GYPaymentSigningKey
- extendedPaymentSigningKeyFromApi ∷ SigningKey PaymentExtendedKey → GYExtendedPaymentSigningKey
- paymentSigningKeyToApi ∷ GYPaymentSigningKey → SigningKey PaymentKey
- extendedPaymentSigningKeyToApi ∷ GYExtendedPaymentSigningKey → SigningKey PaymentExtendedKey
- paymentSigningKeyToLedger ∷ GYPaymentSigningKey → SignKeyDSIGN StandardCrypto
- paymentSigningKeyToLedgerKeyPair ∷ GYPaymentSigningKey → KeyPair Payment StandardCrypto
- paymentSigningKeyFromLedgerKeyPair ∷ KeyPair Payment StandardCrypto → GYPaymentSigningKey
- readPaymentSigningKey ∷ FilePath → IO GYPaymentSigningKey
- readExtendedPaymentSigningKey ∷ FilePath → IO GYExtendedPaymentSigningKey
- writePaymentSigningKey ∷ FilePath → GYPaymentSigningKey → IO ()
- writeExtendedPaymentSigningKey ∷ FilePath → GYExtendedPaymentSigningKey → IO ()
- paymentVerificationKey ∷ GYPaymentSigningKey → GYPaymentVerificationKey
- generatePaymentSigningKey ∷ IO GYPaymentSigningKey
- type GYStakeVerificationKey = GYVerificationKey 'GYKeyRoleStaking
- stakeVerificationKeyFromApi ∷ VerificationKey StakeKey → GYStakeVerificationKey
- stakeVerificationKeyToApi ∷ GYStakeVerificationKey → VerificationKey StakeKey
- stakeKeyHash ∷ GYStakeVerificationKey → GYStakeKeyHash
- stakeVerificationKeyToLedger ∷ GYStakeVerificationKey → VKey Staking StandardCrypto
- type GYStakeSigningKey = GYSigningKey 'GYKeyRoleStaking
- type GYExtendedStakeSigningKey = GYExtendedSigningKey 'GYKeyRoleStaking
- stakeSigningKeyFromApi ∷ SigningKey StakeKey → GYStakeSigningKey
- extendedStakeSigningKeyFromApi ∷ SigningKey StakeExtendedKey → GYExtendedStakeSigningKey
- stakeSigningKeyToApi ∷ GYStakeSigningKey → SigningKey StakeKey
- extendedStakeSigningKeyToApi ∷ GYExtendedStakeSigningKey → SigningKey StakeExtendedKey
- stakeSigningKeyToLedger ∷ GYStakeSigningKey → SignKeyDSIGN StandardCrypto
- stakeSigningKeyToLedgerKeyPair ∷ GYStakeSigningKey → KeyPair Staking StandardCrypto
- stakeSigningKeyFromLedgerKeyPair ∷ KeyPair Staking StandardCrypto → GYStakeSigningKey
- readStakeSigningKey ∷ FilePath → IO GYStakeSigningKey
- readExtendedStakeSigningKey ∷ FilePath → IO GYExtendedStakeSigningKey
- writeStakeSigningKey ∷ FilePath → GYStakeSigningKey → IO ()
- writeExtendedStakeSigningKey ∷ FilePath → GYExtendedStakeSigningKey → IO ()
- stakeVerificationKey ∷ GYStakeSigningKey → GYStakeVerificationKey
- generateStakeSigningKey ∷ IO GYStakeSigningKey
- data GYSomeSigningKey = ∀ a.(ToShelleyWitnessSigningKey a, Show a) ⇒ GYSomeSigningKey a
- data GYSomePaymentSigningKey
- readSomePaymentSigningKey ∷ FilePath → IO GYSomePaymentSigningKey
- somePaymentSigningKeyToSomeSigningKey ∷ GYSomePaymentSigningKey → GYSomeSigningKey
- data GYSomeStakeSigningKey
- readSomeStakeSigningKey ∷ FilePath → IO GYSomeStakeSigningKey
- someStakeSigningKeyToSomeSigningKey ∷ GYSomeStakeSigningKey → GYSomeSigningKey
Documentation
class ToShelleyWitnessSigningKey a where #
Instances
ToShelleyWitnessSigningKey User # | This only takes the payment signing key, not the stake key. |
ToShelleyWitnessSigningKey GYSomePaymentSigningKey # | |
ToShelleyWitnessSigningKey GYSomeSigningKey # | |
ToShelleyWitnessSigningKey GYSomeStakeSigningKey # | |
SingGYKeyRoleI kr ⇒ ToShelleyWitnessSigningKey (GYExtendedSigningKey kr) # | |
SingGYKeyRoleI kr ⇒ ToShelleyWitnessSigningKey (GYSigningKey kr) # | |
Defined in GeniusYield.Types.Key |
Signing key
data GYSigningKey (kr ∷ GYKeyRole) #
>>>
"5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290" :: (GYSigningKey 'GYKeyRolePayment)
GYSigningKey (GYKeyRolePayment) "5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290"
Instances
signingKeyFromRawBytes ∷ ByteString → Maybe (GYSigningKey kr) #
Decode from raw bytes.
signingKeyFromRawBytesHex ∷ ByteString → Either String (GYSigningKey kr) #
Decode from raw bytes represented as hex.
type family GYSigningKeyToApi (kr ∷ GYKeyRole) where ... #
signingKeyToApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYSigningKey kr → GYSigningKeyToApi kr #
signingKeyFromApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYSigningKeyToApi kr → GYSigningKey kr #
generateSigningKey ∷ ∀ kr. SingGYKeyRoleI kr ⇒ IO (GYSigningKey kr) #
writeSigningKey ∷ ∀ kr. (SingGYKeyRoleI kr, HasTextEnvelope (GYSigningKeyToApi kr)) ⇒ FilePath → GYSigningKey kr → IO () #
readSigningKey ∷ ∀ kr. (SingGYKeyRoleI kr, HasTextEnvelope (GYSigningKeyToApi kr)) ⇒ FilePath → IO (GYSigningKey kr) #
signingKeyToLedgerKeyPair ∷ GYSigningKey kr → KeyPair (GYKeyRoleToLedger kr) StandardCrypto #
signingKeyFromLedgerKeyPair ∷ KeyPair (GYKeyRoleToLedger kr) StandardCrypto → GYSigningKey kr #
Verification key
data GYVerificationKey (kr ∷ GYKeyRole) #
Instances
(SingGYKeyRoleI kr, SerialiseAsCBOR (GYVerificationKeyToApi kr)) ⇒ FromJSON (GYVerificationKey kr) # |
|
Defined in GeniusYield.Types.Key parseJSON ∷ Value → Parser (GYVerificationKey kr) # parseJSONList ∷ Value → Parser [GYVerificationKey kr] # omittedField ∷ Maybe (GYVerificationKey kr) # | |
(SingGYKeyRoleI kr, SerialiseAsCBOR (GYVerificationKeyToApi kr)) ⇒ ToJSON (GYVerificationKey kr) # |
|
Defined in GeniusYield.Types.Key toJSON ∷ GYVerificationKey kr → Value # toEncoding ∷ GYVerificationKey kr → Encoding # toJSONList ∷ [GYVerificationKey kr] → Value # toEncodingList ∷ [GYVerificationKey kr] → Encoding # omitField ∷ GYVerificationKey kr → Bool # | |
IsString (GYVerificationKey kr) # | |
Defined in GeniusYield.Types.Key fromString ∷ String → GYVerificationKey kr # | |
SingGYKeyRoleI kr ⇒ Show (GYVerificationKey kr) # | |
Defined in GeniusYield.Types.Key showsPrec ∷ Int → GYVerificationKey kr → ShowS # show ∷ GYVerificationKey kr → String # showList ∷ [GYVerificationKey kr] → ShowS # | |
PrintfArg (GYVerificationKey kr) # |
|
Defined in GeniusYield.Types.Key | |
Eq (GYVerificationKey kr) # | |
Defined in GeniusYield.Types.Key (==) ∷ GYVerificationKey kr → GYVerificationKey kr → Bool # (/=) ∷ GYVerificationKey kr → GYVerificationKey kr → Bool # |
getVerificationKey ∷ GYSigningKey kr → GYVerificationKey kr #
verificationKeyHash ∷ GYVerificationKey kr → GYKeyHash kr #
verificationKeyFromRawBytes ∷ ByteString → Maybe (GYVerificationKey kr) #
Decode from raw bytes.
verificationKeyFromRawBytesHex ∷ ByteString → Either String (GYVerificationKey kr) #
Decode from raw bytes represented as hex.
type family GYVerificationKeyToApi (kr ∷ GYKeyRole) where ... #
verificationKeyToApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYVerificationKey kr → GYVerificationKeyToApi kr #
verificationKeyFromApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYVerificationKeyToApi kr → GYVerificationKey kr #
Extended signing key
data GYExtendedSigningKey (kr ∷ GYKeyRole) #
Extended signing key.
Instances
extendedSigningKeyFromRawBytes ∷ ByteString → Maybe (GYExtendedSigningKey kr) #
Decode from raw bytes.
extendedSigningKeyFromRawBytesHex ∷ ByteString → Either String (GYExtendedSigningKey kr) #
Decode from raw bytes represented as hex.
type family GYExtendedSigningKeyToApi (kr ∷ GYKeyRole) where ... #
extendedSigningKeyToApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYExtendedSigningKey kr → GYExtendedSigningKeyToApi kr #
extendedSigningKeyFromApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYExtendedSigningKeyToApi kr → GYExtendedSigningKey kr #
writeExtendedSigningKey ∷ ∀ kr. (SingGYKeyRoleI kr, HasTextEnvelope (GYExtendedSigningKeyToApi kr)) ⇒ FilePath → GYExtendedSigningKey kr → IO () #
readExtendedSigningKey ∷ ∀ kr. (SingGYKeyRoleI kr, HasTextEnvelope (GYExtendedSigningKeyToApi kr)) ⇒ FilePath → IO (GYExtendedSigningKey kr) #
Payment verification key
type GYPaymentVerificationKey = GYVerificationKey 'GYKeyRolePayment #
type GYPaymentVerificationKey = GYVerificationKey 'GYKeyRolePayment
>>>
"0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605" :: GYPaymentVerificationKey
GYVerificationKey (GYKeyRolePayment) "0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605"
paymentVerificationKeyFromApi ∷ VerificationKey PaymentKey → GYPaymentVerificationKey #
>>>
paymentVerificationKeyFromApi "0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605"
GYVerificationKey (GYKeyRolePayment) "0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605"
paymentVerificationKeyToApi ∷ GYPaymentVerificationKey → VerificationKey PaymentKey #
>>>
paymentVerificationKeyToApi "0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605"
"0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605"
Payment signing key
type GYPaymentSigningKey = GYSigningKey 'GYKeyRolePayment #
type GYPaymentSigningKey = GYSigningKey 'GYKeyRolePayment
>>>
"5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290" :: GYPaymentSigningKey
GYSigningKey (GYKeyRolePayment) "5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290"
type GYExtendedPaymentSigningKey = GYExtendedSigningKey 'GYKeyRolePayment #
type GYExtendedPaymentSigningKey = GYExtendedSigningKey 'GYKeyRolePayment
paymentSigningKeyFromApi ∷ SigningKey PaymentKey → GYPaymentSigningKey #
>>>
paymentSigningKeyFromApi "5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290"
GYSigningKey (GYKeyRolePayment) "5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290"
paymentSigningKeyToApi ∷ GYPaymentSigningKey → SigningKey PaymentKey #
>>>
paymentSigningKeyToApi "5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290"
"5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290"
readPaymentSigningKey ∷ FilePath → IO GYPaymentSigningKey #
Reads a payment signing key from a file.
readExtendedPaymentSigningKey ∷ FilePath → IO GYExtendedPaymentSigningKey #
Reads extended payment signing key from file
writePaymentSigningKey ∷ FilePath → GYPaymentSigningKey → IO () #
Writes a payment signing key to a file.
writeExtendedPaymentSigningKey ∷ FilePath → GYExtendedPaymentSigningKey → IO () #
Writes a extended payment signing key to a file.
paymentVerificationKey ∷ GYPaymentSigningKey → GYPaymentVerificationKey #
>>>
paymentVerificationKey "5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290"
GYVerificationKey (GYKeyRolePayment) "0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605"
generatePaymentSigningKey ∷ IO GYPaymentSigningKey #
Generates a new random payment signing key.
Stake verification key
type GYStakeVerificationKey = GYVerificationKey 'GYKeyRoleStaking #
type GYStakeVerificationKey = GYVerificationKey 'GYKeyRoleStaking
>>>
"0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605" :: GYStakeVerificationKey
GYVerificationKey (GYKeyRoleStaking) "0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605"
stakeVerificationKeyFromApi ∷ VerificationKey StakeKey → GYStakeVerificationKey #
>>>
stakeVerificationKeyFromApi "0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605"
GYVerificationKey (GYKeyRoleStaking) "0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605"
stakeVerificationKeyToApi ∷ GYStakeVerificationKey → VerificationKey StakeKey #
>>>
stakeVerificationKeyToApi "0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605"
"0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605"
Stake signing key
type GYStakeSigningKey = GYSigningKey 'GYKeyRoleStaking #
type GYStakeSigningKey = GYSigningKey 'GYKeyRoleStaking
>>>
"5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290" :: GYStakeSigningKey
GYSigningKey (GYKeyRoleStaking) "5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290"
type GYExtendedStakeSigningKey = GYExtendedSigningKey 'GYKeyRoleStaking #
type GYExtendedStakeSigningKey = GYEExtendedSigningKey 'GYKeyRoleStaking
stakeSigningKeyFromApi ∷ SigningKey StakeKey → GYStakeSigningKey #
>>>
stakeSigningKeyFromApi "5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290"
GYSigningKey (GYKeyRoleStaking) "5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290"
stakeSigningKeyToApi ∷ GYStakeSigningKey → SigningKey StakeKey #
>>>
stakeSigningKeyToApi "5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290"
"5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290"
readStakeSigningKey ∷ FilePath → IO GYStakeSigningKey #
Reads a stake signing key from a file.
readExtendedStakeSigningKey ∷ FilePath → IO GYExtendedStakeSigningKey #
Reads extended stake signing key from file
writeStakeSigningKey ∷ FilePath → GYStakeSigningKey → IO () #
Writes a stake signing key to a file.
writeExtendedStakeSigningKey ∷ FilePath → GYExtendedStakeSigningKey → IO () #
Writes a extended stake signing key to a file.
stakeVerificationKey ∷ GYStakeSigningKey → GYStakeVerificationKey #
>>>
stakeVerificationKey "5ac75cb3435ef38c5bf15d11469b301b13729deb9595133a608fc0881fcec290"
GYVerificationKey (GYKeyRoleStaking) "0717bc56ed4897c3dde0690e3d9ce61e28a55f520fde454f6b5b61305b193605"
generateStakeSigningKey ∷ IO GYStakeSigningKey #
Generates a new random stake signing key.
data GYSomeSigningKey #
∀ a.(ToShelleyWitnessSigningKey a, Show a) ⇒ GYSomeSigningKey a |
data GYSomePaymentSigningKey #
Instances
data GYSomeStakeSigningKey #