Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(7)  |  Derive(0)  |  Import(3)
Creates an ASN1 representation of a public key for external storage.

        def pk_encode_public_key(key):
    """Creates an ASN1 representation of a public key for external storage."""
    return key.encode_key(1)
        


src/m/i/mixminion-HEAD/lib/mixminion/server/ServerKeys.py   mixminion(Download)
    def getIdentityKeyDigest(self):
        """DOCDOC"""
        k = self.getIdentityKey()
        return mixminion.Crypto.sha1(mixminion.Crypto.pk_encode_public_key(k))
 
    identityKeyID = formatBase64(
                      mixminion.Crypto.sha1(
                          mixminion.Crypto.pk_encode_public_key(identityKey)))
 
    fields = {
        "Nickname": nickname,
        "Identity":
           formatBase64(mixminion.Crypto.pk_encode_public_key(identityKey)),
        "Published": formatTime(now),
        "ValidAfter": formatDate(validAt),
        "ValidUntil": formatDate(validUntil),
        "PacketKey":
           formatBase64(mixminion.Crypto.pk_encode_public_key(packetKey)),

src/m/i/mixminion-HEAD/lib/mixminion/ServerInfo.py   mixminion(Download)
     formatBase64, formatDate, formatTime, readPossiblyGzippedFile
from mixminion.Config import ConfigError
from mixminion.Crypto import CryptoError, DIGEST_LEN, pk_check_signature, \
     pk_encode_public_key, pk_fingerprint, pk_sign, sha1
 
    def getKeyDigest(self):
        """Returns a hash of this server's identity key."""
        return sha1(pk_encode_public_key(self['Server']['Identity']))
 
    def getMMTPHostInfo(self):
    def getIdentityDigest(self):
        """Return the digest of this server's public identity key.
           (SHA-1 digest of ASN.1-encoded key).
        """
        return sha1(pk_encode_public_key(self.getIdentity()))

src/m/i/mixminion-HEAD/lib/mixminion/directory/DirFormats.py   mixminion(Download)
 
from mixminion.Config import ConfigError
from mixminion.Crypto import pk_sign, sha1, pk_encode_public_key, \
     pk_fingerprint
 
def getDirectorySignature(directory, pkey):
    digest = mixminion.ServerInfo._getMultisignedDirectoryDigest(directory)
    signature = pk_sign(digest, pkey)
    encKey = formatBase64(pk_encode_public_key(pkey))
    encSig = formatBase64(signature)

src/m/i/mixminion-HEAD/lib/mixminion/directory/ServerList.py   mixminion(Download)
import mixminion.directory.Directory
 
from mixminion.Crypto import pk_decode_public_key, pk_encode_public_key, \
     pk_same_public_key
from mixminion.Common import IntervalSet, LOG, MixError, MixFatalError, \