Package keyczar :: Module keys :: Class DsaPrivateKey
[hide private]
[frames] | no frames]

Class DsaPrivateKey

source code

object --+            
         |            
       Key --+        
             |        
 AsymmetricKey --+    
                 |    
        PrivateKey --+
                     |
                    DsaPrivateKey

Represents DSA private keys in an asymmetric DSA key pair.

Instance Methods [hide private]
 
__init__(self, params, pkcs8, pub, key, size=1024)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
string
Sign(self, msg)
Return raw byte string of signature on the message.
source code
 
Verify(self, msg, sig) source code

Inherited from PrivateKey: __str__

Inherited from PrivateKey (private): _GetKeyString, _Hash

Inherited from Key: Header

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Static Methods [hide private]
DsaPrivateKey
Generate(size=1024)
Return a newly generated DSA private key.
source code
DsaPrivateKey
Read(key)
Reads a DSA private key from a JSON string representation of it.
source code
Properties [hide private]

Inherited from Key: hash, key_bytes, key_string, size

Inherited from object: __class__

Method Details [hide private]

__init__(self, params, pkcs8, pub, key, size=1024)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

Generate(size=1024)
Static Method

source code 

Return a newly generated DSA private key.

Parameters:
  • size (integer) - length of key in bits to generate
Returns: DsaPrivateKey
a DSA private key

Read(key)
Static Method

source code 

Reads a DSA private key from a JSON string representation of it.

Parameters:
  • key (string) - a JSON representation of a DSA private key
Returns: DsaPrivateKey
an DSA private key

Sign(self, msg)

source code 

Return raw byte string of signature on the message.

Parameters:
  • msg (string) - message to be signed
Returns: string
byte string formatted as an ASN.1 sequnce of r and s

Verify(self, msg, sig)

source code