web2ldap  1.7.7
About: web2ldap is a full-featured web-based LDAPv3 client.
  Fossies Dox: web2ldap-1.7.7.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pgpkeysrv.py
Go to the documentation of this file.
1# -*- coding: ascii -*-
2"""
3web2ldap plugin classes for PGP key server
4"""
5
6import re
7
8from ..schema.syntaxes import (
9 DirectoryString,
10 GeneralizedTime,
11 PreformattedMultilineText,
12 DynamicValueSelectList,
13 syntax_registry,
14)
15
16
17syntax_registry.reg_at(
18 GeneralizedTime.oid, [
19 '1.3.6.1.4.1.3401.8.2.17', # pgpKeyCreateTime
20 '1.3.6.1.4.1.3401.8.2.22', # pgpKeyExpireTime
21 ]
22)
23
24
26 oid: str = 'PgpKey-oid'
27 desc: str = 'PGP key'
28 pattern = re.compile(
29 '^-----BEGIN PGP PUBLIC KEY BLOCK-----'
30 '[a-zA-Z0-9.: ()+/ =\n-]+'
31 '-----END PGP PUBLIC KEY BLOCK-----$',
32 re.S+re.M,
33 )
34 lineSep = b'\n'
35 mime_type = 'application/pgp-keys'
36 cols = 64
37
38syntax_registry.reg_at(
39 PgpKey.oid, [
40 '1.3.6.1.4.1.3401.8.2.11', # pgpKey
41 ]
42)
43
44
46 oid: str = 'PgpCertID-oid'
47 desc: str = 'PGP Cert ID'
48 pattern = re.compile('^[a-fA-F0-9]{16}$')
49
50syntax_registry.reg_at(
51 PgpCertID.oid, [
52 '1.3.6.1.4.1.3401.8.2.12', # pgpCertID
53 ]
54)
55
56
58 oid: str = 'OtherPgpCertID-oid'
59 ldap_url = 'ldap:///_?pgpCertID,pgpCertID?sub?(objectClass=pgpKeyInfo)'
60
61 def _validate(self, attr_value: bytes) -> bool:
62 return PgpCertID._validate(self, attr_value)
63
64syntax_registry.reg_at(
65 OtherPgpCertID.oid, [
66 '1.3.6.1.4.1.3401.8.2.18', # pgpSignerID
67 ]
68)
69
70
71# Register all syntax classes in this module
72syntax_registry.reg_syntaxes(__name__)
bool _validate(self, bytes attr_value)
Definition: pgpkeysrv.py:61