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

All Samples(6)  |  Call(5)  |  Derive(0)  |  Import(1)
Load a PEM-encoded private key from a file.  If <password> is provided,
decrypt the key using the password.

        def pk_PEM_load(filename, password=None):
    """Load a PEM-encoded private key from a file.  If  is provided,
       decrypt the key using the password."""
    f = open(filename, 'r')
    if password:
        rsa = _ml.rsa_PEM_read_key(f, 0, password)
    else:
        rsa = _ml.rsa_PEM_read_key(f, 0)
    f.close()
    return rsa
        


src/m/i/mixminion-HEAD/lib/mixminion/server/ServerKeys.py   mixminion(Download)
        if os.path.exists(fn):
            checkPrivateFile(fn)
            key = mixminion.Crypto.pk_PEM_load(fn, password)
            keylen = key.get_modulus_bytes()*8
            if keylen != bits:
    def load(self, password=None):
        """Read the short-term keys from disk.  Must be called before
           getPacketKey or getMMTPKey."""
        self.checkKeys()
        self.packetKey = mixminion.Crypto.pk_PEM_load(self.packetKeyFile,

src/m/i/mixminion-HEAD/lib/mixminion/directory/Directory.py   mixminion(Download)
            return key
        else:
            return mixminion.Crypto.pk_PEM_load(fname)
 
class DirectoryConfig(mixminion.Config._ConfigFile):

src/m/i/mixminion-HEAD/lib/mixminion/directory/DirMain.py   mixminion(Download)
     UIError
from mixminion.Config import ConfigError
from mixminion.Crypto import init_crypto, pk_fingerprint, pk_generate, \
     pk_PEM_load, pk_PEM_save
from mixminion.directory.Directory import Directory, DirectoryConfig

src/m/i/mixminion-HEAD/lib/mixminion/test.py   mixminion(Download)
        mixminion.server.ServerKeys.ServerKeyset(d, "key2", d) # Can we load?
        packetKey = Crypto.pk_PEM_load(
            os.path.join(keydir, "mix.key"))
        eq(packetKey.get_public_key(),
           info['Server']['Packet-Key'].get_public_key())
        identity = keyring.getIdentityKey()
        fn = os.path.join(home, "keys", "identity.key")
        identity2 = Crypto.pk_PEM_load(fn)
        self.assertEquals(Crypto.pk_get_modulus(identity),
                          Crypto.pk_get_modulus(identity2))