Module t.c.s.keys

Part of twisted.conch.ssh View Source

Handling of RSA and DSA keys.

This module is unstable.

Maintainer: Paul Swartz
Class BadKeyError raised when a key isn't what we expected from it.
Function getPublicKeyString Return a public key string given a filename or data of a public key.
Function getPublicKeyString_lsh Undocumented
Function getPublicKeyString_openssh Undocumented
Function makePublicKeyString Return an public key given a Crypto.PublicKey.pubkey.pubkey
Function makePublicKeyString_lsh Undocumented
Function makePublicKeyString_openssh Undocumented
Function getPublicKeyObject Return a Crypto.PublicKey.pubkey.pubkey corresponding to the SSHv2
Function getPrivateKeyObject Return a Crypto.PublicKey.pubkey.pubkey object corresponding to the
Function getPrivateKeyObject_lsh Undocumented
Function getPrivateKeyObject_openssh Undocumented
Function getPrivateKeyObject_agentv3 Undocumented
Function makePrivateKeyString Return an OpenSSH-style private key for a
Function makePrivateKeyString_lsh Undocumented
Function makePrivateKeyString_openssh Undocumented
Function makePrivateKeyString_agentv3 Undocumented
Function makePublicKeyBlob Undocumented
Function makePrivateKeyBlob Undocumented
Function objectType Return the SSH key type corresponding to a Crypto.PublicKey.pubkey.pubkey
Function pkcs1Pad Undocumented
Function pkcs1Digest Undocumented
Function lenSig Undocumented
Function signData Sign the data with the given Crypto.PublicKey.pubkey.pubkey object.
Function signData_rsa Undocumented
Function signData_dsa Undocumented
Function verifySignature Verify that the signature for the data is valid.
Function verifySignature_rsa Undocumented
Function verifySignature_dsa Undocumented
Function printKey Pretty print a Crypto.PublicKey.pubkey.pubkey object.
def getPublicKeyString(filename=None, line=0, data=''): (source)
Return a public key string given a filename or data of a public key. Currently handles OpenSSH and LSH keys.
Parametersfilename(type: str )
line(type: int )
data(type: str )
Returns(type: str )
def getPublicKeyString_lsh(data): (source)
Undocumented
def getPublicKeyString_openssh(data): (source)
Undocumented
def makePublicKeyString(obj, comment='', kind='openssh'): (source)
Return an public key given a Crypto.PublicKey.pubkey.pubkey object. kind is one of ('openssh', 'lsh')
Parametersobj(type: Crypto.PublicKey.pubkey.pubkey )
comment(type: str )
kind(type: str )
Returns(type: str )
def makePublicKeyString_lsh(obj): (source)
Undocumented
def makePublicKeyString_openssh(obj, comment): (source)
Undocumented
def getPublicKeyObject(data): (source)
Return a Crypto.PublicKey.pubkey.pubkey corresponding to the SSHv2 public key data. data is in the over-the-wire public key format.
Parametersdata(type: str )
Returns(type: Crypto.PublicKey.pubkey.pubkey )
def getPrivateKeyObject(filename=None, data='', passphrase=''): (source)
Return a Crypto.PublicKey.pubkey.pubkey object corresponding to the private key file/data. If the private key is encrypted, passphrase must be specified, other wise a BadKeyError will be raised.
Parametersfilename(type: str )
data(type: str )
passphrase(type: str )
RaisesBadKeyErrorif the key is invalid or a passphrase is not specified
def getPrivateKeyObject_lsh(data, passphrase): (source)
Undocumented
def getPrivateKeyObject_openssh(data, passphrase): (source)
Undocumented
def getPrivateKeyObject_agentv3(data, passphrase): (source)
Undocumented
def makePrivateKeyString(obj, passphrase=None, kind='openssh'): (source)
Return an OpenSSH-style private key for a Crypto.PublicKey.pubkey.pubkey object. If passphrase is given, encrypt the private key with it. kind is one of ('openssh', 'lsh', 'agentv3')
Parametersobj(type: Crypto.PublicKey.pubkey.pubkey )
passphrase(type: str/None )
kind(type: str )
Returns(type: str )
def makePrivateKeyString_lsh(obj, passphrase): (source)
Undocumented
def makePrivateKeyString_openssh(obj, passphrase): (source)
Undocumented
def makePrivateKeyString_agentv3(obj, passphrase): (source)
Undocumented
def makePublicKeyBlob(obj): (source)
Undocumented
def makePrivateKeyBlob(obj): (source)
Undocumented
def objectType(obj): (source)
Return the SSH key type corresponding to a Crypto.PublicKey.pubkey.pubkey object.
Parametersobj(type: Crypto.PublicKey.pubkey.pubkey )
Returns(type: str )
def pkcs1Pad(data, lMod): (source)
Undocumented
def pkcs1Digest(data, lMod): (source)
Undocumented
def lenSig(obj): (source)
Undocumented
def signData(obj, data): (source)
Sign the data with the given Crypto.PublicKey.pubkey.pubkey object.
Parametersobj(type: Crypto.PublicKey.pubkey.pubkey )
data(type: str )
Returns(type: str )
def signData_rsa(obj, data): (source)
Undocumented
def signData_dsa(obj, data): (source)
Undocumented
def verifySignature(obj, sig, data): (source)
Verify that the signature for the data is valid.
Parametersobj(type: Crypto.PublicKey.pubkey.pubkey )
sig(type: str )
data(type: str )
Returns(type: bool )
def verifySignature_rsa(obj, sig, data): (source)
Undocumented
def verifySignature_dsa(obj, sig, data): (source)
Undocumented
def printKey(obj): (source)
Pretty print a Crypto.PublicKey.pubkey.pubkey object.
Parametersobj(type: Crypto.PublicKey.pubkey.pubkey )
API Documentation for twisted, generated by pydoctor.