Part of twisted.conch.ssh.keys View Source View In Hierarchy
| Instance Variables | keyObject | The Crypto.PublicKey.pubkey.pubkey object that operations
are performed with.
|
| Class Method | fromFile | Return a Key object corresponding to the data in filename. type and passphrase function as they do in fromString. |
| Class Method | fromString | No summary |
| Method | __init__ | Initialize a PublicKey with a
Crypto.PublicKey.pubkey.pubkey object.
|
| Method | __eq__ | Return True if other represents an object with the same key. |
| Method | __ne__ | Return True if other represents anything other than this key. |
| Method | __repr__ | Return a pretty representation of this object. |
| Method | isPublic | Returns True if this Key is a public key. |
| Method | public | Returns a version of this key containing only the public key data. If this is a public key, this may or may not be the same object as self. |
| Method | type | Return the type of the object we wrap. Currently this can only be 'RSA' or 'DSA'. |
| Method | sshType | Return the type of the object we wrap as defined in the ssh protocol. Currently this can only be 'ssh-rsa' or 'ssh-dss'. |
| Method | data | Return the values of the public key as a dictionary. |
| Method | blob | Return the public key blob for this key. The blob is the over-the-wire format for public keys: |
| Method | toString | No summary |
| Method | sign | Returns a signature with this Key. |
| Method | verify | Returns true if the signature for data is valid for this Key. |
| Class Method | _fromString_BLOB | No summary |
| Class Method | _fromString_PUBLIC_OPENSSH | Return a public key object corresponding to this OpenSSH public key string. The format of an OpenSSH public key string is:: <key type> <base64-encoded public key blob> |
| Class Method | _fromString_PRIVATE_OPENSSH | Return a private key object corresponding to this OpenSSH private key string. If the key is encrypted, passphrase MUST be provided. Providing a passphrase for an unencrypted key is an error. |
| Class Method | _fromString_PUBLIC_LSH | Return a public key corresponding to this LSH public key string. The LSH public key string format is:: <s-expression: ('public-key', (<key type>, (<name, <value>)+))> |
| Class Method | _fromString_PRIVATE_LSH | Return a private key corresponding to this LSH private key string. The LSH private key string format is:: <s-expression: ('private-key', (<key type>, (<name>, <value>)+))> |
| Class Method | _fromString_AGENTV3 | Return a private key object corresponsing to the Secure Shell Key Agent v3 format. |
| Class Method | _guessStringType | Guess the type of key in data. The types map to _fromString_* methods. |
| Method | _toString_OPENSSH | No summary |
| Method | _toString_LSH | Return a public or private LSH key. See _fromString_PUBLIC_LSH and _fromString_PRIVATE_LSH for the key formats. |
| Method | _toString_AGENTV3 | Return a private Secure Shell Agent v3 key. See _fromString_AGENTV3 for the key format. |
| Parameters | data | (type: str
) |
| type | (type: None/str
) | |
| passphrase | (type: None/str
) | |
| Returns | (type: Key
) | |
string 'ssh-rsa' integer e integer nThe format of a DSA public key blob is:
string 'ssh-dss' integer p integer q integer g integer y
| Parameters | blob | (type: str
) |
| Returns | a Crypto.PublicKey.pubkey.pubkey object
| |
| Raises | BadKeyError | if the key type (the first string) is unknown. |
<key type> <base64-encoded public key blob>
| Parameters | data | (type: str
) |
| Returns | A {Crypto.PublicKey.pubkey.pubkey} object | |
| Raises | BadKeyError | if the blob type is unknown. |
Return a private key object corresponding to this OpenSSH private key string. If the key is encrypted, passphrase MUST be provided. Providing a passphrase for an unencrypted key is an error.
The format of an OpenSSH private key string is:-----BEGIN <key type> PRIVATE KEY----- [Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,<initialization value>] <base64-encoded ASN.1 structure> ------END <key type> PRIVATE KEY------The ASN.1 structure of a RSA key is:
(0, n, e, d, p, q)The ASN.1 structure of a DSA key is:
(0, p, q, g, y, x)
| Parameters | data | (type: str
) |
| passphrase | (type: str
) | |
| Returns | a Crypto.PublicKey.pubkey.pubkey object
| |
| Raises | BadKeyError | if * a passphrase is provided for an unencrypted key * a passphrase is not provided for an encrypted key * the ASN.1 encoding is incorrect |
<s-expression: ('public-key', (<key type>, (<name, <value>)+))>
The names for a RSA (key type 'rsa-pkcs1-sha1') key are: n, e. The names
for a DSA (key type 'dsa') key are: y, g, p, q.
| Parameters | data | (type: str
) |
| Returns | a Crypto.PublicKey.pubkey.pubkey object
| |
| Raises | BadKeyError | if the key type is unknown |
<s-expression: ('private-key', (<key type>, (<name>, <value>)+))>
The names for a RSA (key type 'rsa-pkcs1-sha1') key are: n, e, d, p, q.
The names for a DSA (key type 'dsa') key are: y, g, p, q, x.
| Parameters | data | (type: str
) |
| Returns | a {Crypto.PublicKey.pubkey.pubkey} object | |
| Raises | BadKeyError | if the key type is unknown |
Return a private key object corresponsing to the Secure Shell Key Agent v3 format.
The SSH Key Agent v3 format for a RSA key is:string 'ssh-rsa' integer e integer d integer n integer u integer p integer qThe SSH Key Agent v3 format for a DSA key is:
string 'ssh-dss' integer p integer q integer g integer y integer x
| Parameters | data | (type: str
) |
| Returns | a Crypto.PublicKey.pubkey.pubkey object
| |
| Raises | BadKeyError | if the key type (the first string) is unknown |
Crypto.PublicKey.pubkey.pubkey object.
| Parameters | keyObject | (type: Crypto.PublicKey.pubkey.pubkey
) |
Return the public key blob for this key. The blob is the over-the-wire format for public keys:
RSA keys:string 'ssh-rsa' integer e integer nDSA keys:
string 'ssh-dss' integer p integer q integer g integer y
| Returns | (type: str
) | |
| Parameters | type | (type: str
) |
| extra | (type: str
) | |
| Returns | (type: str
) | |
| Parameters | extra | (type: str
) |
| Returns | (type: str
) | |
| Returns | (type: str
) | |
| Returns | (type: str
) | |
| Parameters | data | (type: str
) |
| Returns | (type: str
) | |
| Parameters | signature | (type: str
) |
| data | (type: str
) | |
| Returns | (type: bool
) | |