haskell-tor-0.1.1: A Haskell Tor Node

Safe HaskellNone
LanguageHaskell2010

Tor.State.Credentials

Description

Credential management for a Tor node.

Synopsis

Documentation

data Credentials Source

The current credentials held by the node.

createCertificate :: PubKey -> PrivKey -> Integer -> String -> (DateTime, DateTime) -> SignedExact Certificate Source

Create a new certificate containing the public key and signed by the private key, using the given serial number, CommonName, and validity period.

generateKeyPair :: DRG g => g -> Int -> (PublicKey, PrivateKey, g) Source

Generate a new public/private RSA key pair of the given bit size.

newCredentials :: TorOptions -> IO Credentials Source

Generate new credentials fora fresh node.

getSigningKey :: Credentials -> IO (SignedCertificate, PrivKey) Source

Get the public signing certificate and its associated private key.

getOnionKey :: Credentials -> IO (SignedCertificate, PrivKey) Source

Get the public onion certificate and its associated private key.

getNTorOnionKey :: Credentials -> IO (PublicKey, SecretKey) Source

Get the public NTor Curve25519 public and private keys.

getTLSKey :: Credentials -> IO (SignedCertificate, PrivKey) Source

Get the public TLS certificate and its associated private key.

getAddresses :: Credentials -> IO [TorAddress] Source

Get the current set of addresses we believe are associated with the node. You should make sure to establish at least one outgoing link before calling this.

getRouterDesc :: Credentials -> IO RouterDesc Source

Get our own, current router decsription.

addNewAddresses :: Credentials -> TorAddress -> IO [TorAddress] Source

Add a new set of addresses that should be associated with our node.

isSignedBy :: SignedCertificate -> Certificate -> Bool Source

Return true if the first certificate is signed by the second.