forked from xmlsec/python-xmlsec
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkey.pxd
More file actions
120 lines (82 loc) · 3.63 KB
/
key.pxd
File metadata and controls
120 lines (82 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
from lxml.includes.tree cimport const_xmlChar
cdef extern from *:
ctypedef char const_char "const char"
ctypedef unsigned char const_unsigned_char "const unsigned char"
cdef extern from "xmlsec.h": # xmlsec/keys.h
cdef struct _xmlSecKeyDataKlass:
const_xmlChar* name
const_xmlChar* href
ctypedef _xmlSecKeyDataKlass *xmlSecKeyDataId
xmlSecKeyDataId xmlSecKeyDataNameId
xmlSecKeyDataId xmlSecKeyDataValueId
xmlSecKeyDataId xmlSecKeyDataRetrievalMethodId
xmlSecKeyDataId xmlSecKeyDataEncryptedKeyId
xmlSecKeyDataId xmlSecKeyDataAesId
xmlSecKeyDataId xmlSecKeyDataDesId
xmlSecKeyDataId xmlSecKeyDataDsaId
xmlSecKeyDataId xmlSecKeyDataEcdsaId
xmlSecKeyDataId xmlSecKeyDataHmacId
xmlSecKeyDataId xmlSecKeyDataRsaId
xmlSecKeyDataId xmlSecKeyDataX509Id
xmlSecKeyDataId xmlSecKeyDataRawX509CertId
ctypedef enum xmlSecKeyDataFormat:
xmlSecKeyDataFormatUnknown = 0
xmlSecKeyDataFormatBinary = 1
xmlSecKeyDataFormatPem = 2
xmlSecKeyDataFormatDer = 3
xmlSecKeyDataFormatPkcs8Pem = 4
xmlSecKeyDataFormatPkcs8Der = 5
xmlSecKeyDataFormatPkcs12 = 6
xmlSecKeyDataFormatCertPem = 7
xmlSecKeyDataFormatCertDer = 8
ctypedef unsigned int xmlSecKeyDataType
cdef enum:
xmlSecKeyDataTypeUnknown = 0x0000
xmlSecKeyDataTypeNone = 0x0000
xmlSecKeyDataTypePublic = 0x0001
xmlSecKeyDataTypePrivate = 0x0002
xmlSecKeyDataTypeSymmetric = 0x0004
xmlSecKeyDataTypeSession = 0x0008
xmlSecKeyDataTypePermanent = 0x0010
xmlSecKeyDataTypeTrusted = 0x0100
xmlSecKeyDataTypeAny = 0xFFFF
ctypedef void* xmlSecKeyPtr
cdef struct _xmlSecKeyReq:
pass
ctypedef _xmlSecKeyReq xmlSecKeyReq
ctypedef xmlSecKeyReq* xmlSecKeyReqPtr
void xmlSecKeyDestroy(xmlSecKeyPtr) nogil
xmlSecKeyPtr xmlSecKeyDuplicate(xmlSecKeyPtr) nogil
xmlSecKeyPtr xmlSecCryptoAppKeyLoad(
const_char*, xmlSecKeyDataFormat, const_char*, void*, void *) nogil
xmlSecKeyPtr xmlSecCryptoAppKeyLoadMemory(
const_unsigned_char*, int, xmlSecKeyDataFormat,
const_char*, void*, void*) nogil
xmlSecKeyPtr xmlSecKeyReadBinaryFile(xmlSecKeyDataId, const_char*) nogil
# xmlSecKeyPtr xmlSecKeyReadMemory(
# xmlSecKeyDataId, const_unsigned_char*, size_t) nogil
int xmlSecCryptoAppKeyCertLoad(
xmlSecKeyPtr, const_char*, xmlSecKeyDataFormat) nogil
int xmlSecCryptoAppKeyCertLoadMemory(
xmlSecKeyPtr, const_unsigned_char*, int, xmlSecKeyDataFormat) nogil
xmlSecKeyPtr xmlSecKeyGenerate(
xmlSecKeyDataId, size_t, xmlSecKeyDataType) nogil
int xmlSecKeySetName(xmlSecKeyPtr, const_xmlChar*) nogil
const_xmlChar* xmlSecKeyGetName(xmlSecKeyPtr) nogil
int xmlSecKeyMatch(xmlSecKeyPtr, const_xmlChar *, xmlSecKeyReqPtr) nogil
ctypedef void *xmlSecKeysMngrPtr
xmlSecKeysMngrPtr xmlSecKeysMngrCreate() nogil
void xmlSecKeysMngrDestroy(xmlSecKeysMngrPtr) nogil
int xmlSecCryptoAppDefaultKeysMngrInit(xmlSecKeysMngrPtr) nogil
int xmlSecCryptoAppDefaultKeysMngrAdoptKey(xmlSecKeysMngrPtr, xmlSecKeyPtr) nogil
int xmlSecCryptoAppKeysMngrCertLoad(
xmlSecKeysMngrPtr, char * filename, xmlSecKeyDataFormat, xmlSecKeyDataType) nogil
int xmlSecCryptoAppKeysMngrCertLoadMemory(
xmlSecKeysMngrPtr, const_unsigned_char *, size_t, xmlSecKeyDataFormat, xmlSecKeyDataType) nogil
cdef class _KeyData(object):
cdef xmlSecKeyDataId target
cdef class Key(object):
cdef xmlSecKeyPtr _handle
cdef bint _owner
cdef class KeysManager(object):
cdef xmlSecKeysMngrPtr _handle