gdata.Crypto.PublicKey.RSA | index /usr/local/google/home/afshar/src/external-gdata-release/google3/src/gdata/Crypto/PublicKey/RSA.py

`# RSA.py : RSA encryption/decryption
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitness for use or suitability for any purpose, express
# or implied. Use at your own risk or not at all.
#`

Modules

``

Crypto.PublicKey._fastmath | Crypto.Util.number | Crypto.PublicKey.pubkey |

Classes

``

Crypto.PublicKey.pubkey.pubkey
  RSAobj
  RSAobj
  RSAobj_c
exceptions.Exception(exceptions.BaseException)
  _fastmath.error

class RSAobj(Crypto.PublicKey.pubkey.pubkey)

``

Methods defined here:

can_blind(self)
  `can_blind() : bool
  Return a Boolean value recording whether this algorithm can
  blind data. (This does not imply that this
  particular key object has the private information required to
  to blind a message.)`

has_private(self)
  `has_private() : bool
  Return a Boolean denoting whether the object contains
  private components.`

publickey(self)
  `publickey(): RSAobj
  Return a new key object containing only the public key information.`

size(self)
  `size() : int
  Return the maximum number of bits that can be handled by this key.`

Data and other attributes defined here:

keydata = ['n', 'e', 'd', 'p', 'q', 'u']

Methods inherited from Crypto.PublicKey.pubkey.pubkey:

__eq__(self, other)
  `__eq__(other): 0, 1
  Compare us to other for equality.`

__getstate__(self)
  `To keep key objects platform-independent, the key data is
  converted to standard Python long integers before being
  written out. It will then be reconverted as necessary on
  restoration.`

__init__(self)

__ne__(self, other)
  `__ne__(other): 0, 1
  Compare us to other for inequality.`

__setstate__(self, d)
  `On unpickling a key object, the key data is converted to the big
  number representation being used, whether that is Python long
  integers, MPZ objects, or whatever.`

blind(self, M, B)
  `blind(M : string|long, B : string|long) : string|long
  Blind message M using blinding factor B.`

can_encrypt(self)
  `can_encrypt() : bool
  Return a Boolean value recording whether this algorithm can
  encrypt data. (This does not imply that this
  particular key object has the private information required to
  to decrypt a message.)`

can_sign(self)
  `can_sign() : bool
  Return a Boolean value recording whether this algorithm can
  generate signatures. (This does not imply that this
  particular key object has the private information required to
  to generate a signature.)`

decrypt(self, ciphertext)
  `decrypt(ciphertext:tuple|string|long): string
  Decrypt 'ciphertext' using this key.`

encrypt(self, plaintext, K)
  `encrypt(plaintext:string|long, K:string|long) : tuple
  Encrypt the string or integer plaintext. K is a random
  parameter required by some algorithms.`

sign(self, M, K)
  `sign(M : string|long, K:string|long) : tuple
  Return a tuple containing the signature for the message M.
  K is a random parameter required by some algorithms.`

unblind(self, M, B)
  `unblind(M : string|long, B : string|long) : string|long
  Unblind message M using blinding factor B.`

validate(self, M, signature)
  `# alias to compensate for the old validate() name`

verify(self, M, signature)
  `verify(M:string|long, signature:tuple) : bool
  Verify that the signature is valid for the message M;
  returns true if the signature checks out.`

class RSAobj_c(Crypto.PublicKey.pubkey.pubkey)

``

Methods defined here:

__getattr__(self, attr)

__getstate__(self)

__init__(self, key)

__setstate__(self, state)

can_blind(self)

has_private(self)

publickey(self)

size(self)

Data and other attributes defined here:

keydata = ['n', 'e', 'd', 'p', 'q', 'u']

Methods inherited from Crypto.PublicKey.pubkey.pubkey:

__eq__(self, other)
  `__eq__(other): 0, 1
  Compare us to other for equality.`

__ne__(self, other)
  `__ne__(other): 0, 1
  Compare us to other for inequality.`

blind(self, M, B)
  `blind(M : string|long, B : string|long) : string|long
  Blind message M using blinding factor B.`

can_encrypt(self)
  `can_encrypt() : bool
  Return a Boolean value recording whether this algorithm can
  encrypt data. (This does not imply that this
  particular key object has the private information required to
  to decrypt a message.)`

can_sign(self)
  `can_sign() : bool
  Return a Boolean value recording whether this algorithm can
  generate signatures. (This does not imply that this
  particular key object has the private information required to
  to generate a signature.)`

decrypt(self, ciphertext)
  `decrypt(ciphertext:tuple|string|long): string
  Decrypt 'ciphertext' using this key.`

encrypt(self, plaintext, K)
  `encrypt(plaintext:string|long, K:string|long) : tuple
  Encrypt the string or integer plaintext. K is a random
  parameter required by some algorithms.`

sign(self, M, K)
  `sign(M : string|long, K:string|long) : tuple
  Return a tuple containing the signature for the message M.
  K is a random parameter required by some algorithms.`

unblind(self, M, B)
  `unblind(M : string|long, B : string|long) : string|long
  Unblind message M using blinding factor B.`

validate(self, M, signature)
  `# alias to compensate for the old validate() name`

verify(self, M, signature)
  `verify(M:string|long, signature:tuple) : bool
  Verify that the signature is valid for the message M;
  returns true if the signature checks out.`

class error(exceptions.Exception)

``

Method resolution order:
  error
  exceptions.Exception
  exceptions.BaseException
  __builtin__.object

Data descriptors defined here:

__weakref__
  `list of weak references to the object (if defined)`

Methods inherited from exceptions.Exception:

__init__(...)
  `x.__init__(...) initializes x; see help(type(x)) for signature`

Data and other attributes inherited from exceptions.Exception:

__new__ = <built-in method __new__ of type object>
  `T.__new__(S, ...) -> a new object with type S, a subtype of T`

Methods inherited from exceptions.BaseException:

__delattr__(...)
  `x.__delattr__('name') <==> del x.name`

__getattribute__(...)
  `x.__getattribute__('name') <==> x.name`

__getitem__(...)
  `x.__getitem__(y) <==> x[y]`

__getslice__(...)
  `x.__getslice__(i, j) <==> x[i:j]
  Use of negative indices is not supported.`

__reduce__(...)

__repr__(...)
  `x.__repr__() <==> repr(x)`

__setattr__(...)
  `x.__setattr__('name', value) <==> x.name = value`

__setstate__(...)

__str__(...)
  `x.__str__() <==> str(x)`

__unicode__(...)

Data descriptors inherited from exceptions.BaseException:

__dict__

args

message

object = class RSAobj(Crypto.PublicKey.pubkey.pubkey)

``

Methods defined here:

can_blind(self)
  `can_blind() : bool
  Return a Boolean value recording whether this algorithm can
  blind data. (This does not imply that this
  particular key object has the private information required to
  to blind a message.)`

has_private(self)
  `has_private() : bool
  Return a Boolean denoting whether the object contains
  private components.`

publickey(self)
  `publickey(): RSAobj
  Return a new key object containing only the public key information.`

size(self)
  `size() : int
  Return the maximum number of bits that can be handled by this key.`

Data and other attributes defined here:

keydata = ['n', 'e', 'd', 'p', 'q', 'u']

Methods inherited from Crypto.PublicKey.pubkey.pubkey:

__eq__(self, other)
  `__eq__(other): 0, 1
  Compare us to other for equality.`

__getstate__(self)
  `To keep key objects platform-independent, the key data is
  converted to standard Python long integers before being
  written out. It will then be reconverted as necessary on
  restoration.`

__init__(self)

__ne__(self, other)
  `__ne__(other): 0, 1
  Compare us to other for inequality.`

__setstate__(self, d)
  `On unpickling a key object, the key data is converted to the big
  number representation being used, whether that is Python long
  integers, MPZ objects, or whatever.`

blind(self, M, B)
  `blind(M : string|long, B : string|long) : string|long
  Blind message M using blinding factor B.`

can_encrypt(self)
  `can_encrypt() : bool
  Return a Boolean value recording whether this algorithm can
  encrypt data. (This does not imply that this
  particular key object has the private information required to
  to decrypt a message.)`

can_sign(self)
  `can_sign() : bool
  Return a Boolean value recording whether this algorithm can
  generate signatures. (This does not imply that this
  particular key object has the private information required to
  to generate a signature.)`

decrypt(self, ciphertext)
  `decrypt(ciphertext:tuple|string|long): string
  Decrypt 'ciphertext' using this key.`

encrypt(self, plaintext, K)
  `encrypt(plaintext:string|long, K:string|long) : tuple
  Encrypt the string or integer plaintext. K is a random
  parameter required by some algorithms.`

sign(self, M, K)
  `sign(M : string|long, K:string|long) : tuple
  Return a tuple containing the signature for the message M.
  K is a random parameter required by some algorithms.`

unblind(self, M, B)
  `unblind(M : string|long, B : string|long) : string|long
  Unblind message M using blinding factor B.`

validate(self, M, signature)
  `# alias to compensate for the old validate() name`

verify(self, M, signature)
  `verify(M:string|long, signature:tuple) : bool
  Verify that the signature is valid for the message M;
  returns true if the signature checks out.`

Functions

``

construct = construct_c(tuple)

construct_c(tuple)

construct_py = construct(tuple)
  `construct(tuple:(long,) : RSAobj
  Construct an RSA object from a 2-, 3-, 5-, or 6-tuple of numbers.`

generate = generate_c(bits, randfunc, progress_func=None)

generate_c(bits, randfunc, progress_func=None)

generate_py = generate(bits, randfunc, progress_func=None)
  `generate(bits:int, randfunc:callable, progress_func:callable)
  Generate an RSA key of length 'bits', using 'randfunc' to get
  random data and 'progress_func', if present, to display
  the progress of the key generation.`

Data
`` |  | __revision__ = '$Id: RSA.py,v 1.20 2004/05/06 12:52:54 akuchling Exp $'