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

All Samples(30)  |  Call(17)  |  Derive(0)  |  Import(13)
Convert 's' to a one-line base-64 representation.

            def formatBase64(s):
        """Convert 's' to a one-line base-64 representation."""
        return binascii.b2a_base64(s).strip()
        


src/m/i/mixminion-HEAD/lib/mixminion/server/ServerKeys.py   mixminion(Download)
from mixminion.ServerInfo import ServerInfo, PACKET_KEY_BYTES, MMTP_KEY_BYTES,\
     signServerInfo
from mixminion.Common import AtomicFile, LOG, MixError, MixFatalError, \
     ceilDiv, createPrivateDir, checkPrivateFile, englishSequence, \
     formatBase64, formatDate, formatTime, previousMidnight, readFile, \
    #XXXX009 remove: hasn't been checked since 007 or used since 005.
    identityKeyID = formatBase64(
                      mixminion.Crypto.sha1(
                          mixminion.Crypto.pk_encode_public_key(identityKey)))
 
        "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/directory/DirFormats.py   mixminion(Download)
import mixminion.ServerInfo
 
from mixminion.Common import formatBase64, formatDate, floorDiv, LOG, \
     MixError, previousMidnight
 
            try:
                if n != identNickname[ident]:
                    LOG.warn("Multiple nicknames for %s",formatBase64(ident))
                    badIdents[ident] = 1
            except KeyError:
            if mykeys[k] != u:
                raise BadVote("Mismatched URL for voter %s (%s vs %s)"%(
                    formatBase64(k), u, mykeys[k]))
        except KeyError:
            raise BadVote("Unkown voter %s at %s"%(k,u))
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/server/Pinger.py   mixminion(Download)
import mixminion.server.MMTPServer
 
from mixminion.Common import MixError, AtomicFile, ceilDiv, createPrivateDir, \
     floorDiv, formatBase64, formatFnameDate, formatTime, IntervalSet, LOG, \
     parseFnameDate, previousMidnight, readPickled, secureDelete, \
        ids = ",".join([ str(self._getServerID(s)) for s in path ])
        self._db.getCursor().execute(self._QUEUED_PING,
                             (formatBase64(hash), ids, self._db.time(now), 0))
        self._db.getConnection().commit()
 
        """
        assert len(hash) == mixminion.Crypto.DIGEST_LEN
        self._db.getCursor().execute(self._GOT_PING, (self._db.time(now), formatBase64(hash)))
        n = self._db.getCursor().rowcount
        if n == 0:
        obj = mixminion.server.PacketHandler.RelayedPacket(addr, packet)
        LOG.debug("Pinger queueing ping along path %s [%s]",verbose_path,
                  formatBase64(payloadHash))
        self.pingLog.queuedPing(payloadHash, identity_list)
        self.outgoingQueue.queueDeliveryMessage(obj, addr)

src/m/i/mixminion-HEAD/lib/mixminion/directory/ServerList.py   mixminion(Download)
from mixminion.Crypto import pk_decode_public_key, pk_encode_public_key, \
     pk_same_public_key
from mixminion.Common import IntervalSet, LOG, MixError, MixFatalError, \
     UIError, createPrivateDir, formatBase64, formatDate, formatFnameTime, \
     formatTime, iterFileLines, Lockfile, openUnique, previousMidnight, readFile,\

src/m/i/mixminion-HEAD/lib/mixminion/server/PacketHandler.py   mixminion(Download)
import types
 
from mixminion.Common import encodeBase64, formatBase64, LOG
import mixminion.Crypto as Crypto
import mixminion.Packet as Packet
    def getAsciiTag(self):
        """Return a base64-representation of this message's decoding handle."""
        return formatBase64(self.tag)
 
    def getTextEncodedMessage(self):

src/m/i/mixminion-HEAD/lib/mixminion/ServerInfo.py   mixminion(Download)
import mixminion.Packet
 
from mixminion.Common import IntervalSet, LOG, MixError, createPrivateDir, \
     formatBase64, formatDate, formatTime, readPossiblyGzippedFile
from mixminion.Config import ConfigError
 
    signature = pk_sign(digest,rsa)
    digest = formatBase64(digest)
    signature = formatBase64(signature)
    def replaceFn2(s, digest=digest, signature=signature,

src/m/i/mixminion-HEAD/lib/mixminion/Packet.py   mixminion(Download)
import zlib
from socket import inet_ntoa, inet_aton
from mixminion.Common import MixError, MixFatalError, encodeBase64, \
     floorDiv, formatBase64, formatTime, isSMTPMailbox, LOG, armorText, \
     unarmorText, isPlausibleHostname
    def __str__(self):
        return "IP:%s:%s:%s"%(self.ip,self.port,formatBase64(self.keyinfo))
 
    def __repr__(self):
        return "IPV4Info(%r, %r, %r)"%(self.ip, self.port, self.keyinfo)
    def __str__(self):
        return "%s:%s:%s"%(self.hostname,self.port,formatBase64(self.keyinfo))
 
    def __repr__(self):
        return "MMTPHostInfo(%r, %r, %r)"%(

src/m/i/mixminion-HEAD/lib/mixminion/BuildMessage.py   mixminion(Download)
import mixminion.Fragments
from mixminion.Packet import *
from mixminion.Common import MixError, MixFatalError, LOG, STATUS, UIError, \
     formatBase64
import mixminion.Packet
    replyBlock, secrets, tag = _buildReplyBlockImpl(path, exitType, exitInfo,
                                                    expiryTime, prng, seed)
    STATUS.log("GENERATED_SURB", formatBase64(tag))
    return replyBlock
 

src/m/i/mixminion-HEAD/lib/mixminion/Config.py   mixminion(Download)
import mixminion.NetUtils
 
from mixminion.Common import MixError, LOG, ceilDiv, englishSequence, \
     formatBase64, isPrintingAscii, stripSpace, stringContains, UIError
 

src/m/i/mixminion-HEAD/lib/mixminion/directory/Directory.py   mixminion(Download)
import mixminion.Crypto
 
from mixminion.Common import LOG, MixError, MixFatalError, UIError, \
     formatBase64, iterFileLines, writePickled, readPickled, formatTime
 

  1 | 2  Next