Safe Haskell | None |
---|---|
Language | Haskell2010 |
Credential management for a Tor node.
- data Credentials
- createCertificate :: PubKey -> PrivKey -> Integer -> String -> (DateTime, DateTime) -> SignedExact Certificate
- generateKeyPair :: DRG g => g -> Int -> (PublicKey, PrivateKey, g)
- newCredentials :: TorOptions -> IO Credentials
- getSigningKey :: Credentials -> IO (SignedCertificate, PrivKey)
- getOnionKey :: Credentials -> IO (SignedCertificate, PrivKey)
- getNTorOnionKey :: Credentials -> IO (PublicKey, SecretKey)
- getTLSKey :: Credentials -> IO (SignedCertificate, PrivKey)
- getAddresses :: Credentials -> IO [TorAddress]
- getRouterDesc :: Credentials -> IO RouterDesc
- addNewAddresses :: Credentials -> TorAddress -> IO [TorAddress]
- isSignedBy :: SignedCertificate -> Certificate -> Bool
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.