'Use the data to sign this blob.
Args:
data: String containing the blob data.
signing_key: The key to sign with.
verify_key: Key to verify with. If None we assume the signing key also
contains the public key.
Returns:
self for call chaining.'

def Sign(self, data, signing_key, verify_key=None):

    if (signing_key.KeyLen() < 2048):
        logging.warn('signing    key    is    too    short.')
    self.signature = signing_key.Sign(data)
    self.signature_type = self.SignatureType.RSA_PKCS1v15
    self.digest = hashlib.sha256(data).digest()
    self.digest_type = self.HashType.SHA256
    self.data = data
    if (verify_key is None):
        verify_key = signing_key.GetPublicKey()
    self.Verify(verify_key)
    return self
