parameters: (self, pubkey)
return_statement: return self
docstring: Creates address from a user-supplied ECDSA public key.
  
        The key can be supplied as an (x,y) pair of integers, an EC_Point
        as defined in the lisecdsa class, or as a 65-byte binary string
        (the 64 public key bytes with a 0x04 prefix byte)
  
        This method will fail if the supplied pair of points is not
        on the secp256k1 curve.
docstring_summary: Creates address from a user-supplied ECDSA public key.
docstring_tokens: Creates address from a user - supplied ECDSA public key .
function: def createFromPublicKey(self, pubkey):
        """
        Creates address from a user-supplied ECDSA public key.
  
        The key can be supplied as an (x,y) pair of integers, an EC_Point
        as defined in the lisecdsa class, or as a 65-byte binary string
        (the 64 public key bytes with a 0x04 prefix byte)
  
        This method will fail if the supplied pair of points is not
        on the secp256k1 curve.
        """
        if isinstance(pubkey, tuple) and len(pubkey)==2:
           # We are given public-key (x,y) pair
           binXBE = int_to_binary(pubkey[0], widthBytes=32, endOut=BIGENDIAN)
           binYBE = int_to_binary(pubkey[1], widthBytes=32, endOut=BIGENDIAN)
           self.binPublicKey65 = SecureBinaryData('\x04' + binXBE + binYBE)
           if not CryptoECDSA().VerifyPublicKeyValid(self.binPublicKey65):
              raise KeyDataError, 'Supplied public key is not on secp256k1 curve'
        elif isinstance(pubkey, str) and len(pubkey)==65:
           self.binPublicKey65 = SecureBinaryData(pubkey)
           if not CryptoECDSA().VerifyPublicKeyValid(self.binPublicKey65):
              raise KeyDataError, 'Supplied public key is not on secp256k1 curve'
        else:
           raise KeyDataError, 'Unknown public key format!'
  
        # TODO: I should do a test to see which is faster:
        #           1) Compute the hash directly like this
        #           2) Get the string, hash it in python
        self.addrStr20 = self.binPublicKey65.getHash160()
        self.isInitialized = True
        return self
function_tokens: def createFromPublicKey ( self , pubkey ) : if isinstance ( pubkey , tuple ) and len ( pubkey ) == 2 : # We are given public-key (x,y) pair binXBE = int_to_binary ( pubkey [ 0 ] , widthBytes = 32 , endOut = BIGENDIAN ) binYBE = int_to_binary ( pubkey [ 1 ] , widthBytes = 32 , endOut = BIGENDIAN ) self . binPublicKey65 = SecureBinaryData ( '\x04' + binXBE + binYBE ) if not CryptoECDSA ( ) . VerifyPublicKeyValid ( self . binPublicKey65 ) : raise KeyDataError , 'Supplied public key is not on secp256k1 curve' elif isinstance ( pubkey , str ) and len ( pubkey ) == 65 : self . binPublicKey65 = SecureBinaryData ( pubkey ) if not CryptoECDSA ( ) . VerifyPublicKeyValid ( self . binPublicKey65 ) : raise KeyDataError , 'Supplied public key is not on secp256k1 curve' else : raise KeyDataError , 'Unknown public key format!' # TODO: I should do a test to see which is faster: #           1) Compute the hash directly like this #           2) Get the string, hash it in python self . addrStr20 = self . binPublicKey65 . getHash160 ( ) self . isInitialized = True return self