Beispiel #1
0
 def new(cls, ctx, uri, cert=None):
     if not cert:
         ks = lib.sq_keyserver_new(ctx.ref(), uri.encode())
     else:
         ks = lib.sq_keyserver_with_cert(
             ctx.ref(), uri.encode(),
             ffi.cast("uint8_t *", ffi.from_buffer(cert)), len(cert))
     return KeyServer(ks, context=ctx)
Beispiel #2
0
 def from_bytes(cls, fp):
     return Fingerprint(
         lib.pgp_fingerprint_from_bytes(
             ffi.cast("uint8_t *", ffi.from_buffer(fp)), len(fp)))
Beispiel #3
0
 def from_bytes(cls, fp):
     if len(fp) != 8:
         raise Error("KeyID must be of length 8")
     return KeyID(
         lib.pgp_keyid_from_bytes(ffi.cast("uint8_t *",
                                           ffi.from_buffer(fp))))