botan-low
Copyright(c) 2023-2024 Apotheca Labs
(c) 2024-2025 Haskell Foundation
LicenseBSD-3-Clause
Maintainerjoris@well-typed.com, leo@apotheca.io
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageGHC2021

Botan.Low.PubKey

Description

Public key cryptography is a collection of techniques allowing for encryption, signatures, and key agreement.

Synopsis

Private keys

privKeyCreate Source #

Arguments

:: ByteString

algo_name: something like RSA or ECDSA

-> ByteString

algo_params: is specific to the algorithm. For RSA, specifies the modulus bit length. For ECC is the name of the curve.

-> RNG

rng: a random number generator

-> IO PrivKey

key: the new object will be placed here

Create a new private key

privKeyLoad Source #

Arguments

:: ByteString

bits[]

-> ByteString

password

-> IO PrivKey

key

Input currently assumed to be PKCS #8 structure; Set password to NULL to indicate no encryption expected Starting in 2.8.0, the rng parameter is unused and may be set to null

privKeyCheckKey Source #

Arguments

:: PrivKey

key

-> RNG

rng

-> CheckKeyFlags

flags

-> IO () 

Check the validity of a private key

privKeyGetField Source #

Arguments

:: MP

output

-> PrivKey

key

-> ByteString

field_name

-> IO () 

Get arbitrary named fields from public or private keys

privKeyExport Source #

Arguments

:: PrivKey

key

-> PrivKeyExportFlags

flags

-> IO ByteString

out[]

On input *out_len is number of bytes in out[] On output *out_len is number of bytes written (or required) If out is not big enough no output is written, *out_len is set and 1 is returned Returns 0 on success and sets If some other error occurs a negative integer is returned.

Public Keys

pubKeyLoad Source #

Arguments

:: ByteString

bits[]

-> IO PubKey

key

pubKeyAlgoName Source #

Arguments

:: PubKey

key

-> IO ByteString

out[]

pubKeyCheckKey Source #

Arguments

:: PubKey

key

-> RNG

rng

-> CheckKeyFlags

flags

-> IO Bool 

pubKeyEstimatedStrength Source #

Arguments

:: PubKey

key

-> IO Int

estimate

pubKeyGetField Source #

Arguments

:: MP

output

-> PubKey

key

-> ByteString

field_name

-> IO () 

Get arbitrary named fields from public or private keys

pubKeyExport Source #

Arguments

:: PubKey

key

-> PubKeyExportFlags

flags

-> IO ByteString

out[]

PK Algorithms

pattern RSA :: PKName Source #

pattern SM2 :: PKName Source #

pattern ElGamal :: PKName Source #

pattern DSA :: PKName Source #

pattern ECDSA :: PKName Source #

pattern ECKCDSA :: PKName Source #

pattern ECGDSA :: PKName Source #

pattern Ed25519 :: PKName Source #

pattern XMSS :: PKName Source #

pattern DH :: PKName Source #

pattern ECDH :: PKName Source #

pattern Kyber :: PKName Source #

pattern McEliece :: PKName Source #

DLGroup

ECGroup

XMSS

EME

type EMEName = ByteString Source #

Encoding Method for Encryption

WARNING: Name is not completely accurate, may be changed to PKEncryptParams

pattern EME_RAW :: EMEName Source #

EMSA

type EMSAName = ByteString Source #

Encoding Method for Signature with Appendix

WARNING: Name is not completely accurate, may be changed to PKSignParams

Convenience