Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6keystore.h
Go to the documentation of this file.
1 
10 #ifndef P6KEYSTORE_H__
11 #define P6KEYSTORE_H__ 1
12 
13 #include "p6crypto.h"
14 #include "p6sign.h"
15 #include "p6cert.h"
16 #include "p6cryptokey.h"
17 #include "p6symmetric.h"
18 #include "p6enumwstr.h"
19 
20 
21 
22 namespace P6R {
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
41 const P6KEYSTOREFLAGS P6KEYSTORE_NOFLAGS = 0x00000000;
42 const P6KEYSTOREFLAGS P6KEYSTORE_RECOVERBADSIG = 0x00000001;
43 const P6KEYSTOREFLAGS P6KEYSTORE_NOLOADMETA = 0x00000002;
44 
58 typedef enum {
59  ENTRY_NULL = 0x00,
60  ENTRY_KEY = 0x01,
61  ENTRY_CERT = 0x02,
62  ENTRY_BLOB = 0x03,
63  ENTRY_LINK = 0x04
65 
66 
68 const P6UINT32 P6KSMAXNAME = 500;
73 
88 typedef struct
89 {
91  P6WCHAR szNamespace[ P6KSMAXNAMESPACE ];
92  P6WCHAR szName[ P6KSMAXNAME ];
95 
96 
116 typedef struct
117 {
123  P6WCHAR szMetaData[ P6KSMAXLINKMETA ];
125 
126 
145 typedef struct
146 {
149  union {
150  P6WCHAR szValueStr[ P6KSMAXATTRIBSTR ];
153  } value;
154 } P6KEYSTORE_ATTRIBUTE;
155 
156 
164 {
179  P6COMMETHOD next( P6UINT32 cElements, P6KEYSTORE_ENTRY* parElements, P6UINT32* pcReturned ) = 0;
180 
189  P6COMMETHOD reset() = 0;
190 };
191 // {2FEA7C69-C0CF-4a80-842F-01974B79EBDA}
192 #define IF_p6IEnumKeystore {0x2fea7c69,0xc0cf,0x4a80,{0x84,0x2f,0x1,0x97,0x4b,0x79,0xeb,0xda}}
193 
194 
201 {
216  P6COMMETHOD next( P6UINT32 cElements, P6KEYSTORE_ATTRIBUTE* parElements, P6UINT32* pcReturned ) = 0;
217 
226  P6COMMETHOD reset() = 0;
227 };
228 // {2A52D3F3-F42C-4a0b-AE85-B0AACC82B4BF}
229 #define IF_p6IEnumKeystoreAttrib {0x2a52d3f3,0xf42c,0x4a0b,{0xae,0x85,0xb0,0xaa,0xcc,0x82,0xb4,0xbf}}
230 
231 
239 {
259  P6COMMETHOD enumKeyBySize( P6UINT32 size, P6INT8 comparator, p6IEnumKeystore** ppEnum ) = 0;
260 
277 
294 
311 
327  P6COMMETHOD enumKeyByExpired( P6TIME expired, p6IEnumKeystore** ppEnum ) = 0;
328 
344  P6COMMETHOD enumKeyByRenewal( P6TIME expired, p6IEnumKeystore** ppEnum ) = 0;
345 
366  P6COMMETHOD enumKeyBySizeByCipher( P6UINT32 size, P6INT8 comparator, P6CRYPTOCIPHER cipher, p6IEnumKeystore** ppEnum ) = 0;
367 
388  P6COMMETHOD enumKeyBySizeByClass( P6UINT32 size, P6INT8 comparator, P6CRYPTOKEYCLASS keyClass, p6IEnumKeystore** ppEnum ) = 0;
389 
410  P6COMMETHOD enumKeyLikeCipher( const P6WCHAR* pCipher, p6IEnumKeystore** ppEnum ) = 0;
411 
429  P6COMMETHOD enumKeyLikeDescriptiveLabel( const P6WCHAR* pDescription, p6IEnumKeystore** ppEnum ) = 0;
430 
448  P6COMMETHOD enumKeyLikeUse( const P6WCHAR* pUse, p6IEnumKeystore** ppEnum ) = 0;
449 
464  P6COMMETHOD enumCertBySubject( const P6WCHAR* pSubject, p6IEnumKeystore** ppEnum ) = 0;
465 
481  P6COMMETHOD enumLinkBySource( P6UUID* pSource, p6IEnumKeystore** ppEnum ) = 0;
482 
498  P6COMMETHOD enumLinkByTarget( P6UUID* pTarget, p6IEnumKeystore** ppEnum ) = 0;
499 
517  P6COMMETHOD enumLinkLikeType( const P6WCHAR* pType, p6IEnumKeystore** ppEnum ) = 0;
518 };
519 // {B3541C2E-703E-416d-B0CD-3035A7B76098}
520 #define IF_p6IKeystoreQuery {0xb3541c2e,0x703e,0x416d,{0xb0,0xcd,0x30,0x35,0xa7,0xb7,0x60,0x98}}
521 
533 {
534 
555  P6COMMETHOD initialize( P6KEYSTOREFLAGS flags,
556  p6ISymmetricCrypto* pEncryptKey,
557  P6SIGNHMAC signAlg,
558  p6ICryptoKey* pSignKey ) = 0;
559 
587  P6COMMETHOD openSigned( const P6WCHAR* pPath, const P6WCHAR* pKeystoreName ) = 0;
588 
609  P6COMMETHOD open( const P6WCHAR* pURI ) = 0;
610 
620  P6COMMETHOD close() = 0;
621 
632  P6COMMETHOD resetStore() = 0;
633 };
634 
635 /*{CE121684-4E87-63FD-BFA6-AF86BE5C6DA5}*/
636 #define IF_p6IKeystoreInit {0xCE121684,0x4E87,0x63FD,{0xBF,0xA6,0xAF,0x86,0xBE,0x5C,0x6D,0xA5}}
637 
646 interface p6IKeystore : public p6ICom
647 {
665  P6COMMETHOD getKey( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICryptoKey** pKey ) = 0;
666 
681  P6COMMETHOD getKeyByUUID( P6UUID* pUUID, p6ICryptoKey** pKey ) = 0;
682 
700  P6COMMETHOD getCertificate( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICert** pCert ) = 0;
701 
716  P6COMMETHOD getCertificateByUUID( P6UUID* pUUID, p6ICert** pCert ) = 0;
717 
734  P6COMMETHOD getCertificateByFingerprint( P6WCHAR* pFingerprint, P6DIGESTS digest, p6ICert** pCert ) = 0;
735 
757  P6COMMETHOD getCertificateChain( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICert** pCertChain, P6UINT32 numChain, P6UINT32* pNumWritten ) = 0;
758 
777  P6COMMETHOD getCertificateChainByUUID( P6UUID* pUUID, p6ICert** pCertChain, P6UINT32 numChain, P6UINT32* pNumWritten ) = 0;
778 
797  P6COMMETHOD getBlob( const P6WCHAR* pNamespace, const P6WCHAR* pName, P6BSTR* pBlob ) = 0;
798 
813  P6COMMETHOD getBlobByUUID( P6UUID* pUUID, P6BSTR* pBlob ) = 0;
814 
829  P6COMMETHOD getLinkByUUID( P6UUID* pUUID, P6KEYSTORE_LINK* pLink ) = 0;
830 
845  P6COMMETHOD getType( P6UUID* pUUID, P6KEYSTORE_ENTRY* pType ) = 0;
846 
867  P6COMMETHOD setKey( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICryptoKey* pKey, p6ICert** pCertChain, P6UINT32 numChain, P6UUID* pUUID ) = 0;
868 
887  P6COMMETHOD setCertificate( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICert* pCert, P6UUID* pUUID ) = 0;
888 
907  P6COMMETHOD setBlob( const P6WCHAR* pNamespace, const P6WCHAR* pName, P6BSTR blob, P6UUID* pUUID ) = 0;
908 
930  P6COMMETHOD createLink( P6UUID* pSourceUUID, P6UUID* pTargetUUID, const P6WCHAR* pLinkType, const P6WCHAR* pMetaData, P6UUID* pUUID ) = 0;
931 
948  P6COMMETHOD deleteKey( const P6WCHAR* pNamespace, const P6WCHAR* pName ) = 0;
949 
966  P6COMMETHOD deleteCertificate( const P6WCHAR* pNamespace, const P6WCHAR* pName ) = 0;
967 
984  P6COMMETHOD deleteBlob( const P6WCHAR* pNamespace, const P6WCHAR* pName ) = 0;
985 
999  P6COMMETHOD deleteItem( P6UUID* pUUID ) = 0;
1000 
1021  P6COMMETHOD replaceKey( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICryptoKey* pKey, p6ICert** pCertChain, P6UINT32 numChain ) = 0;
1022 
1040  P6COMMETHOD replaceKeyByUUID( P6UUID* pUUID, p6ICryptoKey* pKey, p6ICert** pCertChain, P6UINT32 numChain ) = 0;
1041 
1059  P6COMMETHOD replaceCertificate( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICert* pCert ) = 0;
1060 
1075  P6COMMETHOD replaceCertificateByUUID( P6UUID* pUUID, p6ICert* pCert ) = 0;
1076 
1094  P6COMMETHOD replaceBlob( const P6WCHAR* pNamespace, const P6WCHAR* pName, P6BSTR blob ) = 0;
1095 
1110  P6COMMETHOD replaceBlobByUUID( P6UUID* pUUID, P6BSTR blob ) = 0;
1111 
1132  P6COMMETHOD updateKeyMetaData( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICryptoKey* pKey ) = 0;
1133 
1152 
1171  P6COMMETHOD enumEntries( P6KEYSTORE_TYPE byType, const P6WCHAR* pNamespace, p6IEnumKeystore** ppEnum ) = 0;
1172 
1187  P6COMMETHOD enumNamespaces( p6IEnumWStr** ppEnum ) = 0;
1188 };
1189 
1190 // {6ECB5D85-2751-49ad-99DA-2AA173FC2737}
1191 #define IF_p6IKeystore {0x6ecb5d85,0x2751,0x49ad,{0x99,0xda,0x2a,0xa1,0x73,0xfc,0x27,0x37}}
1192 
1193 // {C65CDFF1-4E4A-4bba-9E38-1273C8895E0F}
1194 #define COMP_p6Keystore {0xc65cdff1,0x4e4a,0x4bba,{0x9e,0x38,0x12,0x73,0xc8,0x89,0x5e,0xf}}
1195 
1196 
1197 
1205 {
1225  P6COMMETHOD enumKeyBySize( P6UINT32 size, P6INT8 comparator, p6IEnumKeystore** ppEnum ) = 0;
1226 
1243 
1260 
1276  P6COMMETHOD enumKeyByClass( P6CRYPTOKEYCLASS keyClass, p6IEnumKeystore** ppEnum ) = 0;
1277 
1293  P6COMMETHOD enumKeyByExpired( P6TIME expired, p6IEnumKeystore** ppEnum ) = 0;
1294 
1310  P6COMMETHOD enumKeyByRenewal( P6TIME expired, p6IEnumKeystore** ppEnum ) = 0;
1311 
1332  P6COMMETHOD enumKeyBySizeByCipher( P6UINT32 size, P6INT8 comparator, P6CRYPTOCIPHER cipher, p6IEnumKeystore** ppEnum ) = 0;
1333 
1354  P6COMMETHOD enumKeyBySizeByClass( P6UINT32 size, P6INT8 comparator, P6CRYPTOKEYCLASS keyClass, p6IEnumKeystore** ppEnum ) = 0;
1355 
1376  P6COMMETHOD enumKeyLikeCipher( const P6WCHAR* pCipher, p6IEnumKeystore** ppEnum ) = 0;
1377 
1395  P6COMMETHOD enumKeyLikeDescriptiveLabel( const P6WCHAR* pDescription, p6IEnumKeystore** ppEnum ) = 0;
1396 
1414  P6COMMETHOD enumKeyLikeUse( const P6WCHAR* pUse, p6IEnumKeystore** ppEnum ) = 0;
1415 
1430  P6COMMETHOD enumCertBySubject( const P6WCHAR* pSubject, p6IEnumKeystore** ppEnum ) = 0;
1431 
1447  P6COMMETHOD enumLinkBySource( P6UUID* pSource, p6IEnumKeystore** ppEnum ) = 0;
1448 
1464  P6COMMETHOD enumLinkByTarget( P6UUID* pTarget, p6IEnumKeystore** ppEnum ) = 0;
1465 
1483  P6COMMETHOD enumLinkLikeType( const P6WCHAR* pType, p6IEnumKeystore** ppEnum ) = 0;
1484 
1501  P6COMMETHOD enumByAttributeName( P6KEYSTORE_TYPE entryType, const P6WCHAR* pName, p6IEnumKeystore** ppEnum ) = 0;
1502 
1520  P6COMMETHOD enumByAttributeString( P6KEYSTORE_TYPE entryType, const P6WCHAR* pName, const P6WCHAR* pValueStr, p6IEnumKeystore** ppEnum ) = 0;
1521 
1543  P6COMMETHOD enumByAttributeInteger( P6KEYSTORE_TYPE entryType, const P6WCHAR* pName, P6INT32 valueInt, P6INT8 comparitor, p6IEnumKeystore** ppEnum ) = 0;
1544 
1566  P6COMMETHOD enumByAttributeTime( P6KEYSTORE_TYPE entryType, const P6WCHAR* pName, P6TIME timeStamp, P6INT8 comparitor, p6IEnumKeystore** ppEnum ) = 0;
1567 };
1568 // {319939EA-C0F5-4ad1-B401-D1EF09AA182C}
1569 #define IF_p6IKeystoreQuery2 {0x319939ea,0xc0f5,0x4ad1,{0xb4,0x1,0xd1,0xef,0x9,0xaa,0x18,0x2c}}
1570 
1571 
1581 interface p6IKeystore2 : public p6ICom
1582 {
1600  P6COMMETHOD getKey( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICryptoKey** pKey ) = 0;
1601 
1616  P6COMMETHOD getKeyByUUID( P6UUID* pUUID, p6ICryptoKey** pKey ) = 0;
1617 
1635  P6COMMETHOD getCertificate( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICert** pCert ) = 0;
1636 
1651  P6COMMETHOD getCertificateByUUID( P6UUID* pUUID, p6ICert** pCert ) = 0;
1652 
1669  P6COMMETHOD getCertificateByFingerprint( P6WCHAR* pFingerprint, P6DIGESTS digest, p6ICert** pCert ) = 0;
1670 
1692  P6COMMETHOD getCertificateChain( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICert** pCertChain, P6UINT32 numChain, P6UINT32* pNumWritten ) = 0;
1693 
1712  P6COMMETHOD getCertificateChainByUUID( P6UUID* pUUID, p6ICert** pCertChain, P6UINT32 numChain, P6UINT32* pNumWritten ) = 0;
1713 
1732  P6COMMETHOD getBlob( const P6WCHAR* pNamespace, const P6WCHAR* pName, P6BSTR* pBlob ) = 0;
1733 
1748  P6COMMETHOD getBlobByUUID( P6UUID* pUUID, P6BSTR* pBlob ) = 0;
1749 
1764  P6COMMETHOD getLinkByUUID( P6UUID* pUUID, P6KEYSTORE_LINK* pLink ) = 0;
1765 
1780  P6COMMETHOD getType( P6UUID* pUUID, P6KEYSTORE_ENTRY* pType ) = 0;
1781 
1802  P6COMMETHOD setKey( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICryptoKey* pKey, p6ICert** pCertChain, P6UINT32 numChain, P6UUID* pUUID ) = 0;
1803 
1822  P6COMMETHOD setCertificate( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICert* pCert, P6UUID* pUUID ) = 0;
1823 
1842  P6COMMETHOD setBlob( const P6WCHAR* pNamespace, const P6WCHAR* pName, P6BSTR blob, P6UUID* pUUID ) = 0;
1843 
1865  P6COMMETHOD createLink( P6UUID* pSourceUUID, P6UUID* pTargetUUID, const P6WCHAR* pLinkType, const P6WCHAR* pMetaData, P6UUID* pUUID ) = 0;
1866 
1883  P6COMMETHOD deleteKey( const P6WCHAR* pNamespace, const P6WCHAR* pName ) = 0;
1884 
1901  P6COMMETHOD deleteCertificate( const P6WCHAR* pNamespace, const P6WCHAR* pName ) = 0;
1902 
1919  P6COMMETHOD deleteBlob( const P6WCHAR* pNamespace, const P6WCHAR* pName ) = 0;
1920 
1934  P6COMMETHOD deleteItem( P6UUID* pUUID ) = 0;
1935 
1956  P6COMMETHOD replaceKey( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICryptoKey* pKey, p6ICert** pCertChain, P6UINT32 numChain ) = 0;
1957 
1975  P6COMMETHOD replaceKeyByUUID( P6UUID* pUUID, p6ICryptoKey* pKey, p6ICert** pCertChain, P6UINT32 numChain ) = 0;
1976 
1994  P6COMMETHOD replaceCertificate( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICert* pCert ) = 0;
1995 
2010  P6COMMETHOD replaceCertificateByUUID( P6UUID* pUUID, p6ICert* pCert ) = 0;
2011 
2029  P6COMMETHOD replaceBlob( const P6WCHAR* pNamespace, const P6WCHAR* pName, P6BSTR blob ) = 0;
2030 
2045  P6COMMETHOD replaceBlobByUUID( P6UUID* pUUID, P6BSTR blob ) = 0;
2046 
2067  P6COMMETHOD updateKeyMetaData( const P6WCHAR* pNamespace, const P6WCHAR* pName, p6ICryptoKey* pKey ) = 0;
2068 
2087 
2106  P6COMMETHOD enumEntries( P6KEYSTORE_TYPE byType, const P6WCHAR* pNamespace, p6IEnumKeystore** ppEnum ) = 0;
2107 
2122  P6COMMETHOD enumNamespaces( p6IEnumWStr** ppEnum ) = 0;
2123 
2140  P6COMMETHOD addAttribute( P6UUID* pUUID, P6KEYSTORE_ATTRIBUTE newAttrib ) = 0;
2141 
2158  P6COMMETHOD updateAttribute( P6UUID* pUUID, P6KEYSTORE_ATTRIBUTE changeAttrib ) = 0;
2159 
2176  P6COMMETHOD getAttribute( P6UUID* pUUID, P6KEYSTORE_ATTRIBUTE* pAttrib ) = 0;
2177 
2193  P6COMMETHOD deleteAttribute( P6UUID* pUUID, const P6WCHAR* pName ) = 0;
2194 
2210  P6COMMETHOD enumAttributes( P6UUID* pUUID, p6IEnumKeystoreAttrib** ppEnum ) = 0;
2211 };
2212 
2213 // {8B158122-6543-45c3-A84E-B274045BAC9C}
2214 #define IF_p6IKeystore2 {0x8b158122,0x6543,0x45c3,{0xa8,0x4e,0xb2,0x74,0x4,0x5b,0xac,0x9c}}
2215 
2216 // {1878D1AA-F326-4f82-AA05-AE1F30156AF0}
2217 #define COMP_p6Keystore2 {0x1878d1aa,0xf326,0x4f82,{0xaa,0x5,0xae,0x1f,0x30,0x15,0x6a,0xf0}}
2218 
2219 
2220 
2225 #define P6_KEYSTORE_SERVICE_INTERFACE "p6r.com.p6IKeystore.Global"
2226 
2227 #ifdef __cplusplus
2228 }
2229 #endif
2230 
2231 } // namespace
2232 
2233 
2234 #endif
2235 
2236 
2237 
2238 
2239 
2240 
P6SIGNHMAC
Supported HMAC algorthms for signing:
Definition: p6sign.h:46
virtual P6R::P6ERR updateKeyMetaData(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICryptoKey *pKey)=0
Allows the modification of the meta data associated with an existing key.
virtual P6R::P6ERR enumLinkByTarget(P6UUID *pTarget, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the link entries in a keys...
virtual P6R::P6ERR enumKeyBySize(P6UINT32 size, P6INT8 comparator, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR reset()=0
This method is used to re-start the enumerator at the beginning.
virtual P6R::P6ERR getCertificateByFingerprint(P6WCHAR *pFingerprint, P6DIGESTS digest, p6ICert **pCert)=0
Finds and returns an existing certificate with the matching fingerprint.
This interface allows the caller to find an existing key, certificate, or blob (e.g., password) by a namespace and name pair.
Definition: p6keystore.h:646
virtual P6R::P6ERR replaceCertificateByUUID(P6UUID *pUUID, p6ICert *pCert)=0
Deletes an existing certificate matching the global unique identifer, and then creates a new certific...
virtual P6R::P6ERR replaceCertificate(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICert *pCert)=0
Deletes an existing certificate matching the 'pNamespace pName' identifer, and then creates a new cer...
virtual P6R::P6ERR deleteBlob(const P6WCHAR *pNamespace, const P6WCHAR *pName)=0
Deletes the blob defined by the 'pNamespace pName' from the keystore.
virtual P6R::P6ERR setKey(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICryptoKey *pKey, p6ICert **pCertChain, P6UINT32 numChain, P6UUID *pUUID)=0
Creates a new key in the keystore with the matching 'pNamespace pName' identifier.
virtual P6R::P6ERR getKeyByUUID(P6UUID *pUUID, p6ICryptoKey **pKey)=0
Finds and returns an existing key with the matching global unique identifer.
Cryptography component definitions.
This interface provides key metadata infrormation and key access.
Definition: p6cryptokey.h:787
P6KEYSTORE_TYPE sourceType
Definition: p6keystore.h:118
virtual P6R::P6ERR enumKeyLikeUse(const P6WCHAR *pUse, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
unsigned int P6UINT32
Definition: p6types.h:40
This is an often used construct where an application needs to provide an unknown number of wide strin...
virtual P6R::P6ERR getType(P6UUID *pUUID, P6KEYSTORE_ENTRY *pType)=0
Given the UUID return the objects type, Namespace, and Name parameters.
virtual P6R::P6ERR replaceBlobByUUID(P6UUID *pUUID, P6BSTR blob)=0
Deletes an existing blob matching the global unique identifer, and then creates a new blob (with the ...
virtual P6R::P6ERR enumKeyLikeCipher(const P6WCHAR *pCipher, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
P6UINT32 P6KEYSTOREFLAGS
P6KEYSTOREFLAGS.
Definition: p6keystore.h:40
virtual P6R::P6ERR replaceCertificateByUUID(P6UUID *pUUID, p6ICert *pCert)=0
Deletes an existing certificate matching the global unique identifer, and then creates a new certific...
const P6KEYSTOREFLAGS P6KEYSTORE_NOFLAGS
Definition: p6keystore.h:41
virtual P6R::P6ERR enumKeyLikeDescriptiveLabel(const P6WCHAR *pDescription, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR getCertificateChainByUUID(P6UUID *pUUID, p6ICert **pCertChain, P6UINT32 numChain, P6UINT32 *pNumWritten)=0
Finds and returns a certificate chain associated with an existing key.
This interface allows the user to enumerate keys or certificates based on different sets of meta data...
Definition: p6keystore.h:238
virtual P6R::P6ERR deleteCertificate(const P6WCHAR *pNamespace, const P6WCHAR *pName)=0
Deletes the certificate defined by the 'pNamespace pName' identifier from the keystore.
virtual P6R::P6ERR enumLinkLikeType(const P6WCHAR *pType, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the link entries in a keys...
This interface allows the caller to find an existing key, certificate, or blob (e.g., password) by a namespace and name pair.
Definition: p6keystore.h:1581
virtual P6R::P6ERR enumByAttributeString(P6KEYSTORE_TYPE entryType, const P6WCHAR *pName, const P6WCHAR *pValueStr, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the entries in a keystore ...
virtual P6R::P6ERR enumAttributes(P6UUID *pUUID, p6IEnumKeystoreAttrib **ppEnum)=0
The returned enumerator can be used to walk all the attributes associated with an entry in the keysto...
P6CRYPTOKEYCLASS
Used to categorize keys:
Definition: p6cryptokey.h:49
virtual P6R::P6ERR openSigned(const P6WCHAR *pPath, const P6WCHAR *pKeystoreName)=0
Allows the caller access to the contents of a keystore.
virtual P6R::P6ERR enumKeyByCipher(P6CRYPTOCIPHER cipher, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR getKey(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICryptoKey **pKey)=0
Finds and returns an existing key with the matching 'pNamespace pName' identifer (e.g., 'SSH host_key' )
virtual P6R::P6ERR setBlob(const P6WCHAR *pNamespace, const P6WCHAR *pName, P6BSTR blob, P6UUID *pUUID)=0
Creates a new blob in the keystore with the matching 'pNamespace pName' identifier.
virtual P6R::P6ERR setKey(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICryptoKey *pKey, p6ICert **pCertChain, P6UINT32 numChain, P6UUID *pUUID)=0
Creates a new key in the keystore with the matching 'pNamespace pName' identifier.
char P6INT8
Definition: p6types.h:31
P6KEYSTORE_TYPE
Value indicates the type of data returned in a P6R::p6IEnumKeystore enumerator.
Definition: p6keystore.h:58
virtual P6R::P6ERR getType(P6UUID *pUUID, P6KEYSTORE_ENTRY *pType)=0
Given the UUID return the objects type, Namespace, and Name parameters.
virtual P6R::P6ERR updateKeyMetaDataByUUID(P6UUID *pUUID, p6ICryptoKey *pKey)=0
Allows the modification of the meta data associated with an existing key.
virtual P6R::P6ERR getAttribute(P6UUID *pUUID, P6KEYSTORE_ATTRIBUTE *pAttrib)=0
Get the value of the attribute associated to an object in the keystore.
virtual P6R::P6ERR deleteItem(P6UUID *pUUID)=0
Deletes an entry in the keystore by its global unique identifer.
virtual P6R::P6ERR replaceKey(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICryptoKey *pKey, p6ICert **pCertChain, P6UINT32 numChain)=0
Deletes an existing key matching the 'pNamespace pName' identifer, and then creates a new key (with t...
const P6UINT32 P6KSMAXATTRIBNAME
Definition: p6keystore.h:71
virtual P6R::P6ERR resetStore()=0
Deletes all entries in the openned keystore (i.e., setting the keystore to its initial empty state)...
virtual P6R::P6ERR enumEntries(P6KEYSTORE_TYPE byType, const P6WCHAR *pNamespace, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the entries in a keystore...
virtual P6R::P6ERR next(P6UINT32 cElements, P6KEYSTORE_ENTRY *parElements, P6UINT32 *pcReturned)=0
This method is used to iterate by identifer and type the defined entires in a keystore.
const P6UINT32 P6KSMAXNAME
Definition: p6keystore.h:68
virtual P6R::P6ERR enumKeyByClass(P6CRYPTOKEYCLASS keyClass, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR enumNamespaces(p6IEnumWStr **ppEnum)=0
The returned enumerator can be used to get a list of all namespaces defined in a keystore.
const P6UINT32 P6KSMAXATTRIBSTR
Definition: p6keystore.h:72
virtual P6R::P6ERR replaceBlob(const P6WCHAR *pNamespace, const P6WCHAR *pName, P6BSTR blob)=0
Deletes an existing blob matching the 'pNamespace pName' identifer, and then creates a new blob (with...
P6CRYPTOCIPHER
Cipher Type.
Definition: p6crypto.h:99
virtual P6R::P6ERR setBlob(const P6WCHAR *pNamespace, const P6WCHAR *pName, P6BSTR blob, P6UUID *pUUID)=0
Creates a new blob in the keystore with the matching 'pNamespace pName' identifier.
virtual P6R::P6ERR enumKeyBySizeByCipher(P6UINT32 size, P6INT8 comparator, P6CRYPTOCIPHER cipher, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR getKeyByUUID(P6UUID *pUUID, p6ICryptoKey **pKey)=0
Finds and returns an existing key with the matching global unique identifer.
virtual P6R::P6ERR updateKeyMetaData(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICryptoKey *pKey)=0
Allows the modification of the meta data associated with an existing key.
const P6KEYSTOREFLAGS P6KEYSTORE_RECOVERBADSIG
Definition: p6keystore.h:42
virtual P6R::P6ERR enumKeyByExpired(P6TIME expired, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
const P6KEYSTOREFLAGS P6KEYSTORE_NOLOADMETA
Definition: p6keystore.h:43
wchar_t P6WCHAR
Wide character type see p6i18n.h.
Definition: p6types.h:76
Interface definitions for symmetric key encryption.
int P6INT32
Definition: p6types.h:41
virtual P6R::P6ERR getCertificate(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICert **pCert)=0
Finds and returns an existing certificate with the matching 'pNamespace pName' identifier.
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
virtual P6R::P6ERR deleteKey(const P6WCHAR *pNamespace, const P6WCHAR *pName)=0
Deletes the key defined by the 'pNamespace pName' identifer from the keystore.
virtual P6R::P6ERR getLinkByUUID(P6UUID *pUUID, P6KEYSTORE_LINK *pLink)=0
Finds and returns an existing link with the matching global unique identifer.
virtual P6R::P6ERR open(const P6WCHAR *pURI)=0
Allows the caller access to the contents of a keystore.
virtual P6R::P6ERR enumKeyByExpired(P6TIME expired, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR enumKeyByState(P6CRYPTOKEYSTATE state, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR enumCertBySubject(const P6WCHAR *pSubject, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to find one or more certificates with the given subject...
virtual P6R::P6ERR enumByAttributeInteger(P6KEYSTORE_TYPE entryType, const P6WCHAR *pName, P6INT32 valueInt, P6INT8 comparitor, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the entries in a keystore ...
virtual P6R::P6ERR next(P6UINT32 cElements, P6KEYSTORE_ATTRIBUTE *parElements, P6UINT32 *pcReturned)=0
This method is used to iterate by identifer and type the defined entires in a keystore.
virtual P6R::P6ERR initialize(P6KEYSTOREFLAGS flags, p6ISymmetricCrypto *pEncryptKey, P6SIGNHMAC signAlg, p6ICryptoKey *pSignKey)=0
Sets up the component to run properly.
virtual P6R::P6ERR reset()=0
This method is used to re-start the enumerator at the beginning.
P6KEYSTORE_TYPE type
Definition: p6keystore.h:90
virtual P6R::P6ERR enumEntries(P6KEYSTORE_TYPE byType, const P6WCHAR *pNamespace, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the entries in a keystore...
The p6IEnumKeystore returns this type in order to distinguish between the keys, certs, blobs, and links that can all be stored in the same keystore.
Definition: p6keystore.h:88
virtual P6R::P6ERR replaceKeyByUUID(P6UUID *pUUID, p6ICryptoKey *pKey, p6ICert **pCertChain, P6UINT32 numChain)=0
Deletes an existing key matching the global unique identifer, and then creates a new key (with the sa...
virtual P6R::P6ERR getCertificateByFingerprint(P6WCHAR *pFingerprint, P6DIGESTS digest, p6ICert **pCert)=0
Finds and returns an existing certificate with the matching fingerprint.
This interface is a general purpose string enumerator.
Definition: p6enumwstr.h:28
Binary string.
Definition: p6types.h:154
virtual P6R::P6ERR enumKeyByRenewal(P6TIME expired, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR updateKeyMetaDataByUUID(P6UUID *pUUID, p6ICryptoKey *pKey)=0
Allows the modification of the meta data associated with an existing key.
virtual P6R::P6ERR getCertificateChain(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICert **pCertChain, P6UINT32 numChain, P6UINT32 *pNumWritten)=0
Finds and returns a certificate chain associated with an existing key.
virtual P6R::P6ERR enumByAttributeTime(P6KEYSTORE_TYPE entryType, const P6WCHAR *pName, P6TIME timeStamp, P6INT8 comparitor, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the entries in a keystore ...
P6CRYPTOKEYSTATE
The current state of the key as defined in: NIST DRAFT Special Publication 800-130, A Framework for Designing Cryptographic Key Management Systems, June 15, 2010.
Definition: p6cryptokey.h:356
virtual P6R::P6ERR createLink(P6UUID *pSourceUUID, P6UUID *pTargetUUID, const P6WCHAR *pLinkType, const P6WCHAR *pMetaData, P6UUID *pUUID)=0
Creates a new link between two entries in the keystore.
Interface definition for X509 V3 Certificates.
virtual P6R::P6ERR setCertificate(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICert *pCert, P6UUID *pUUID)=0
Creates a new certificate in the keystore with the matching 'pNamespace pName' identifier.
A universally unique indentifier (UUID).
Definition: p6types.h:131
virtual P6R::P6ERR setCertificate(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICert *pCert, P6UUID *pUUID)=0
Creates a new certificate in the keystore with the matching 'pNamespace pName' identifier.
virtual P6R::P6ERR getCertificateChain(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICert **pCertChain, P6UINT32 numChain, P6UINT32 *pNumWritten)=0
Finds and returns a certificate chain associated with an existing key.
virtual P6R::P6ERR getKey(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICryptoKey **pKey)=0
Finds and returns an existing key with the matching 'pNamespace pName' identifer (e.g., 'SSH host_key' )
const P6UINT32 P6KSMAXNAMESPACE
Definition: p6keystore.h:67
virtual P6R::P6ERR enumKeyLikeCipher(const P6WCHAR *pCipher, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR getCertificateByUUID(P6UUID *pUUID, p6ICert **pCert)=0
Finds and returns an existing certificate with the matching global unique identifier.
This enumerator allows the caller to get a list of all defined entries that exist in the openned keys...
Definition: p6keystore.h:163
virtual P6R::P6ERR deleteKey(const P6WCHAR *pNamespace, const P6WCHAR *pName)=0
Deletes the key defined by the 'pNamespace pName' identifer from the keystore.
This interface allows the caller to access parts of an X509 V3 certificate for use in protocols and i...
Definition: p6cert.h:180
virtual P6R::P6ERR enumCertBySubject(const P6WCHAR *pSubject, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to find one or more certificates with the given subject...
const P6UINT32 P6KSMAXLINKMETA
Definition: p6keystore.h:70
virtual P6R::P6ERR addAttribute(P6UUID *pUUID, P6KEYSTORE_ATTRIBUTE newAttrib)=0
Add the attribute to an object in the keystore.
virtual P6R::P6ERR updateAttribute(P6UUID *pUUID, P6KEYSTORE_ATTRIBUTE changeAttrib)=0
Change the value of an existing attribute to an object in the keystore.
virtual P6R::P6ERR getBlob(const P6WCHAR *pNamespace, const P6WCHAR *pName, P6BSTR *pBlob)=0
Finds and returns an existing array of untyped bytes (i.e., a blob) with the matching 'pNamespace pNa...
virtual P6R::P6ERR deleteItem(P6UUID *pUUID)=0
Deletes an entry in the keystore by its global unique identifer.
virtual P6R::P6ERR replaceCertificate(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICert *pCert)=0
Deletes an existing certificate matching the 'pNamespace pName' identifer, and then creates a new cer...
virtual P6R::P6ERR enumKeyBySizeByClass(P6UINT32 size, P6INT8 comparator, P6CRYPTOKEYCLASS keyClass, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR enumKeyByCipher(P6CRYPTOCIPHER cipher, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
#define P6COMMETHOD
Definition: p6types.h:872
virtual P6R::P6ERR enumByAttributeName(P6KEYSTORE_TYPE entryType, const P6WCHAR *pName, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the entries in a keystore ...
virtual P6R::P6ERR getCertificate(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICert **pCert)=0
Finds and returns an existing certificate with the matching 'pNamespace pName' identifier.
This interface provides symmetric key encryption/decryption using AES, Blowfish, CAST5 DES and varian...
Definition: p6symmetric.h:62
virtual P6R::P6ERR getLinkByUUID(P6UUID *pUUID, P6KEYSTORE_LINK *pLink)=0
Finds and returns an existing link with the matching global unique identifer.
P6INT64 P6TIME
The wallclock time represented as the number of microseconds since midnight January 1 1970 UTC...
Definition: p6types.h:228
A key, certificate, and blob can have any number of associated attributes.
Definition: p6keystore.h:145
virtual P6R::P6ERR deleteCertificate(const P6WCHAR *pNamespace, const P6WCHAR *pName)=0
Deletes the certificate defined by the 'pNamespace pName' identifier from the keystore.
The p6IKeystore interface uses the following definition for link retrival.
Definition: p6keystore.h:116
virtual P6R::P6ERR enumLinkLikeType(const P6WCHAR *pType, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the link entries in a keys...
virtual P6R::P6ERR enumKeyByRenewal(P6TIME expired, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
This enumerator allows the caller to get a list of all defined attributes associated with a specific ...
Definition: p6keystore.h:200
virtual P6R::P6ERR getBlobByUUID(P6UUID *pUUID, P6BSTR *pBlob)=0
Finds and returns an existing array of untyped bytes (i.e., a blob) with the matching global unique i...
virtual P6R::P6ERR getCertificateChainByUUID(P6UUID *pUUID, p6ICert **pCertChain, P6UINT32 numChain, P6UINT32 *pNumWritten)=0
Finds and returns a certificate chain associated with an existing key.
virtual P6R::P6ERR enumKeyBySizeByClass(P6UINT32 size, P6INT8 comparator, P6CRYPTOKEYCLASS keyClass, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR replaceBlob(const P6WCHAR *pNamespace, const P6WCHAR *pName, P6BSTR blob)=0
Deletes an existing blob matching the 'pNamespace pName' identifer, and then creates a new blob (with...
virtual P6R::P6ERR replaceKey(const P6WCHAR *pNamespace, const P6WCHAR *pName, p6ICryptoKey *pKey, p6ICert **pCertChain, P6UINT32 numChain)=0
Deletes an existing key matching the 'pNamespace pName' identifer, and then creates a new key (with t...
virtual P6R::P6ERR enumKeyBySize(P6UINT32 size, P6INT8 comparator, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR deleteAttribute(P6UUID *pUUID, const P6WCHAR *pName)=0
Remove an attribute that is associated to an object in the keystore.
Interface definition for the cryptographic signature generation and verification. ...
virtual P6R::P6ERR getBlobByUUID(P6UUID *pUUID, P6BSTR *pBlob)=0
Finds and returns an existing array of untyped bytes (i.e., a blob) with the matching global unique i...
P6KEYSTORE_TYPE targetType
Definition: p6keystore.h:119
virtual P6R::P6ERR enumKeyByState(P6CRYPTOKEYSTATE state, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR enumLinkBySource(P6UUID *pSource, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the link entries in a keys...
virtual P6R::P6ERR enumLinkBySource(P6UUID *pSource, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the link entries in a keys...
This interface allows the user to enumerate keys or certificates based on different sets of meta data...
Definition: p6keystore.h:1204
virtual P6R::P6ERR deleteBlob(const P6WCHAR *pNamespace, const P6WCHAR *pName)=0
Deletes the blob defined by the 'pNamespace pName' from the keystore.
virtual P6R::P6ERR enumKeyByClass(P6CRYPTOKEYCLASS keyClass, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
const P6UINT32 P6KSMAXLINKTYPE
Definition: p6keystore.h:69
virtual P6R::P6ERR enumNamespaces(p6IEnumWStr **ppEnum)=0
The returned enumerator can be used to get a list of all namespaces defined in a keystore.
virtual P6R::P6ERR getCertificateByUUID(P6UUID *pUUID, p6ICert **pCert)=0
Finds and returns an existing certificate with the matching global unique identifier.
virtual P6R::P6ERR enumKeyBySizeByCipher(P6UINT32 size, P6INT8 comparator, P6CRYPTOCIPHER cipher, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR replaceKeyByUUID(P6UUID *pUUID, p6ICryptoKey *pKey, p6ICert **pCertChain, P6UINT32 numChain)=0
Deletes an existing key matching the global unique identifer, and then creates a new key (with the sa...
virtual P6R::P6ERR enumKeyLikeDescriptiveLabel(const P6WCHAR *pDescription, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR close()=0
Closes access to keystore contents.
virtual P6R::P6ERR enumLinkByTarget(P6UUID *pTarget, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the link entries in a keys...
virtual P6R::P6ERR enumKeyLikeUse(const P6WCHAR *pUse, p6IEnumKeystore **ppEnum)=0
The returned enumerator can be used to walk all the entires or a subset of the key entries in a keyst...
virtual P6R::P6ERR replaceBlobByUUID(P6UUID *pUUID, P6BSTR blob)=0
Deletes an existing blob matching the global unique identifer, and then creates a new blob (with the ...
P6DIGESTS
Definition: p6digest.h:295
virtual P6R::P6ERR getBlob(const P6WCHAR *pNamespace, const P6WCHAR *pName, P6BSTR *pBlob)=0
Finds and returns an existing array of untyped bytes (i.e., a blob) with the matching 'pNamespace pNa...
virtual P6R::P6ERR createLink(P6UUID *pSourceUUID, P6UUID *pTargetUUID, const P6WCHAR *pLinkType, const P6WCHAR *pMetaData, P6UUID *pUUID)=0
Creates a new link between two entries in the keystore.
This interface is used to create/open/manage the keystore.
Definition: p6keystore.h:532
P6R Cryptographic key interface definitions.