Changeset 100442 in vbox for trunk/include
- Timestamp:
- Jul 8, 2023 11:10:51 AM (18 months ago)
- Location:
- trunk/include/iprt
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/crypto/key.h
r98103 r100442 66 66 /** RSA public key. */ 67 67 RTCRKEYTYPE_RSA_PUBLIC, 68 /** ECDSA private key. */ 69 RTCRKEYTYPE_ECDSA_PRIVATE, 70 /** ECDSA public key. */ 71 RTCRKEYTYPE_ECDSA_PUBLIC, 68 72 /** End of key types. */ 69 73 RTCRKEYTYPE_END, … … 75 79 RTDECL(int) RTCrKeyCreateFromSubjectPublicKeyInfo(PRTCRKEY phKey, struct RTCRX509SUBJECTPUBLICKEYINFO const *pSrc, 76 80 PRTERRINFO pErrInfo, const char *pszErrorTag); 77 RTDECL(int) RTCrKeyCreateFromPublicAlgorithmAndBits(PRTCRKEY phKey, 78 PCRTASN1 BITSTRING pPublicKey,81 RTDECL(int) RTCrKeyCreateFromPublicAlgorithmAndBits(PRTCRKEY phKey, PCRTASN1OBJID pAlgorithm, 82 PCRTASN1DYNTYPE pParameters, PCRTASN1BITSTRING pPublicKey, 79 83 PRTERRINFO pErrInfo, const char *pszErrorTag); 80 84 RTDECL(int) RTCrKeyCreateFromPemSection(PRTCRKEY phKey, uint32_t fFlags, struct RTCRPEMSECTION const *pSection, … … 105 109 RTDECL(int) RTCrKeyQueryRsaModulus(RTCRKEY hKey, PRTBIGNUM pModulus); 106 110 RTDECL(int) RTCrKeyQueryRsaPrivateExponent(RTCRKEY hKey, PRTBIGNUM pPrivateExponent); 111 RTDECL(int) RTCrKeyVerifyParameterCompatibility(RTCRKEY hKey, PCRTASN1DYNTYPE pParameters, bool fForSignature, 112 PCRTASN1OBJID pAlgorithm, PRTERRINFO pErrInfo); 113 107 114 108 115 /** Public key markers. */ -
trunk/include/iprt/crypto/pkix.h
r98103 r100442 60 60 * @param pAlgorithm The signature algorithm (digest w/ cipher). 61 61 * @param hPublicKey The public key. 62 * @param pParameters Parameter to the public key algorithm. Optional. 62 * @param pParameters The signature parameters (not key, those are already 63 * kept by hPublicKey). 63 64 * @param pSignatureValue The signature value. 64 65 * @param pvData The signed data. … … 81 82 * @param pAlgorithm The signature algorithm (digest w/ cipher). 82 83 * @param hPublicKey The public key. 83 * @param pParameters Parameter to the public key algorithm. Optional. 84 * @param pParameters The signature parameters (not key, those are already 85 * kept by hPublicKey). 84 86 * @param pvSignedDigest The signed digest. 85 87 * @param cbSignedDigest The signed digest size. … … 146 148 * 147 149 * @returns Cipher OID string on success, NULL on failure. 148 * @param pAlgorithm The signature algorithm (digest w/ cipher). 150 * @param pAlgorithm The signature algorithm (hash function w/ cipher). 151 * @sa RTCrX509AlgorithmIdentifier_GetEncryptionOid, 152 * RTCrX509AlgorithmIdentifier_GetEncryptionOidFromOid 149 153 */ 150 154 RTDECL(const char *) RTCrPkixGetCiperOidFromSignatureAlgorithm(PCRTASN1OBJID pAlgorithm); 155 156 /** 157 * Gets the cipher OID matching the given signature algorithm OID. 158 * 159 * @returns Cipher OID string on success, NULL on failure. 160 * @param pszSignatureOid The signature algorithm ID (hash function w/ cipher). 161 * @sa RTCrX509AlgorithmIdentifier_GetEncryptionOid, 162 * RTCrX509AlgorithmIdentifier_GetEncryptionOidFromOid 163 */ 164 RTDECL(const char *) RTCrPkixGetCiperOidFromSignatureAlgorithmOid(const char *pszSignatureOid); 151 165 152 166 … … 170 184 #define RTCR_PKCS1_SHA512T224_WITH_RSA_OID "1.2.840.113549.1.1.15" 171 185 #define RTCR_PKCS1_SHA512T256_WITH_RSA_OID "1.2.840.113549.1.1.16" 186 /** @} */ 187 188 /** @name ANSI X9.62 Object Identifiers (OIDs) 189 * @{ */ 190 #define RTCR_X962_ECDSA_OID "1.2.840.10045.2.1" 191 #define RTCR_X962_ECDSA_WITH_SHA1_OID "1.2.840.10045.4.1" 192 #define RTCR_X962_ECDSA_WITH_SHA2_OID "1.2.840.10045.4.3" 193 #define RTCR_X962_ECDSA_WITH_SHA224_OID "1.2.840.10045.4.3.1" 194 #define RTCR_X962_ECDSA_WITH_SHA256_OID "1.2.840.10045.4.3.2" 195 #define RTCR_X962_ECDSA_WITH_SHA384_OID "1.2.840.10045.4.3.3" 196 #define RTCR_X962_ECDSA_WITH_SHA512_OID "1.2.840.10045.4.3.4" 197 /** @} */ 198 199 /** @name NIST Object Identifiers (OIDs) 200 * @{ */ 201 #define RTCR_NIST_ALGORITHM_OID "2.16.840.1.101.3.4" 202 #define RTCR_NIST_HASH_ALGS_OID "2.16.840.1.101.3.4.2" 203 #define RTCR_NIST_SIG_ALGS_OID "2.16.840.1.101.3.4.3" 204 #define RTCR_NIST_SHA3_224_WITH_ECDSA_OID "2.16.840.1.101.3.4.3.9" 205 #define RTCR_NIST_SHA3_256_WITH_ECDSA_OID "2.16.840.1.101.3.4.3.10" 206 #define RTCR_NIST_SHA3_384_WITH_ECDSA_OID "2.16.840.1.101.3.4.3.11" 207 #define RTCR_NIST_SHA3_512_WITH_ECDSA_OID "2.16.840.1.101.3.4.3.12" 208 #define RTCR_NIST_SHA3_224_WITH_RSA_OID "2.16.840.1.101.3.4.3.13" 209 #define RTCR_NIST_SHA3_256_WITH_RSA_OID "2.16.840.1.101.3.4.3.14" 210 #define RTCR_NIST_SHA3_384_WITH_RSA_OID "2.16.840.1.101.3.4.3.15" 211 #define RTCR_NIST_SHA3_512_WITH_RSA_OID "2.16.840.1.101.3.4.3.16" 172 212 /** @} */ 173 213 … … 300 340 * @param ppvOpaque Where to store an opaque schema parameter. Optional. 301 341 */ 302 PCRTCRPKIXSIGNATUREDESC RTCrPkixSignatureFindByObjIdString(const char *pszObjId, void * ppvOpaque);342 PCRTCRPKIXSIGNATUREDESC RTCrPkixSignatureFindByObjIdString(const char *pszObjId, void **ppvOpaque); 303 343 304 344 /** -
trunk/include/iprt/crypto/x509.h
r98103 r100442 81 81 * 82 82 * @returns Valid RTDIGESTTYPE on success, RTDIGESTTYPE_INVALID on failure. 83 * @param pThis The IPRT representation of a X.509 algorithm 84 * identifier object. 85 */ 86 RTDECL(RTDIGESTTYPE) RTCrX509AlgorithmIdentifier_QueryDigestType(PCRTCRX509ALGORITHMIDENTIFIER pThis); 83 * @param pThis The IPRT representation of a X.509 algorithm 84 * identifier object. 85 * @param fPureDigestsOnly Whether to only match IDs that only identify 86 * digest algorithms, or whether to also include 87 * IDs that mixes hash and encryption/whatever. 88 */ 89 RTDECL(RTDIGESTTYPE) RTCrX509AlgorithmIdentifier_GetDigestType(PCRTCRX509ALGORITHMIDENTIFIER pThis, bool fPureDigestsOnly); 87 90 88 91 /** … … 90 93 * 91 94 * @returns The digest size in bytes, UINT32_MAX if unknown digest. 92 * @param pThis The IPRT representation of a X.509 algorithm 93 * identifier object. 94 */ 95 RTDECL(uint32_t) RTCrX509AlgorithmIdentifier_QueryDigestSize(PCRTCRX509ALGORITHMIDENTIFIER pThis); 95 * @param pThis The IPRT representation of a X.509 algorithm 96 * identifier object. 97 * @param fPureDigestsOnly Whether to only match IDs that only identify 98 * digest algorithms, or whether to also include 99 * IDs that mixes hash and encryption/whatever. 100 */ 101 RTDECL(uint32_t) RTCrX509AlgorithmIdentifier_GetDigestSize(PCRTCRX509ALGORITHMIDENTIFIER pThis, bool fPureDigestsOnly); 102 103 /** 104 * Tries to get the encryption OID from the algorithm. 105 * 106 * @returns The encryption (cipher) OID on success, NULL on failure. 107 * @param pThis The IPRT representation of a X.509 algorithm 108 * identifier object. 109 * @param fMustIncludeHash Whether the algorithm ID represented by @a pThis 110 * must include a hash (true) or whether it is 111 * okay to accept pure encryption IDs as well 112 * (false). 113 */ 114 RTDECL(const char *) RTCrX509AlgorithmIdentifier_GetEncryptionOid(PCRTCRX509ALGORITHMIDENTIFIER pThis, bool fMustIncludeHash); 115 116 /** 117 * Tries to get the encryption OID from the given algorithm OID string. 118 * 119 * @returns The encryption (cipher) OID on success, NULL on failure. 120 * @param pszAlgorithmOid The IPRT representation of a X.509 algorithm 121 * identifier object. 122 * @param fMustIncludeHash Whether @a pszAlgorithmOid must include a hash 123 * (true) or whether it is okay to accept pure 124 * encryption IDs as well (false). 125 */ 126 RTDECL(const char *) RTCrX509AlgorithmIdentifier_GetEncryptionOidFromOid(const char *pszAlgorithmOid, bool fMustIncludeHash); 96 127 97 128 RTDECL(int) RTCrX509AlgorithmIdentifier_CompareWithString(PCRTCRX509ALGORITHMIDENTIFIER pThis, const char *pszObjId); … … 155 186 #define RTCRX509ALGORITHMIDENTIFIERID_MD4 "1.2.840.113549.2.4" 156 187 #define RTCRX509ALGORITHMIDENTIFIERID_MD5 "1.2.840.113549.2.5" 188 #define RTCRX509ALGORITHMIDENTIFIERID_SHA0 "1.3.14.3.2.18" 157 189 #define RTCRX509ALGORITHMIDENTIFIERID_SHA1 "1.3.14.3.2.26" 158 190 #define RTCRX509ALGORITHMIDENTIFIERID_SHA256 "2.16.840.1.101.3.4.2.1" … … 188 220 #define RTCRX509ALGORITHMIDENTIFIERID_SHA3_384_WITH_RSA "2.16.840.1.101.3.4.3.15" 189 221 #define RTCRX509ALGORITHMIDENTIFIERID_SHA3_512_WITH_RSA "2.16.840.1.101.3.4.3.16" 222 #define RTCRX509ALGORITHMIDENTIFIERID_ECDSA "1.2.840.10045.2.1" 223 #define RTCRX509ALGORITHMIDENTIFIERID_SHA1_WITH_ECDSA "1.2.840.10045.4.1" 224 #define RTCRX509ALGORITHMIDENTIFIERID_SHA224_WITH_ECDSA "1.2.840.10045.4.3.1" 225 #define RTCRX509ALGORITHMIDENTIFIERID_SHA256_WITH_ECDSA "1.2.840.10045.4.3.2" 226 #define RTCRX509ALGORITHMIDENTIFIERID_SHA384_WITH_ECDSA "1.2.840.10045.4.3.3" 227 #define RTCRX509ALGORITHMIDENTIFIERID_SHA512_WITH_ECDSA "1.2.840.10045.4.3.4" 228 #define RTCRX509ALGORITHMIDENTIFIERID_SHA3_224_WITH_ECDSA "2.16.840.1.101.3.4.3.9" 229 #define RTCRX509ALGORITHMIDENTIFIERID_SHA3_256_WITH_ECDSA "2.16.840.1.101.3.4.3.10" 230 #define RTCRX509ALGORITHMIDENTIFIERID_SHA3_384_WITH_ECDSA "2.16.840.1.101.3.4.3.11" 231 #define RTCRX509ALGORITHMIDENTIFIERID_SHA3_512_WITH_ECDSA "2.16.840.1.101.3.4.3.12" 190 232 /** @} */ 191 233 -
trunk/include/iprt/err.h
r100029 r100442 2170 2170 /** Expected RSA public key. */ 2171 2171 #define VERR_CR_PKIX_NOT_RSA_PUBLIC_KEY (-23524) 2172 /** Expected ECDSA private key. */ 2173 #define VERR_CR_PKIX_NOT_ECDSA_PRIVATE_KEY (-23525) 2174 /** Expected ECDSA public key. */ 2175 #define VERR_CR_PKIX_NOT_ECDSA_PUBLIC_KEY (-23526) 2176 /** OpenSSL failed to decode the key parameters. */ 2177 #define VERR_CR_PKIX_OSSL_D2I_KEY_PARAMS_FAILED (-23527) 2172 2178 /** @} */ 2173 2179 … … 2213 2219 /** Failed to generate RSA key. */ 2214 2220 #define VERR_CR_KEY_GEN_FAILED_RSA (-23815) 2221 /** Key algorithm parameters not expected. */ 2222 #define VERR_CR_KEY_ALGO_PARAMS_UNEXPECTED (-23816) 2223 /** Key algorithm parameters are required but missing. */ 2224 #define VERR_CR_KEY_ALGO_PARAMS_MISSING (-23817) 2225 /** Key algorithm parameters are not known/supported. */ 2226 #define VERR_CR_KEY_ALGO_PARAMS_UNKNOWN (-23818) 2227 /** Algorithm parameters does not match the key. */ 2228 #define VERR_CR_KEY_ALGO_PARAMS_MISMATCH (-23819) 2229 2215 2230 /** @} */ 2216 2231 -
trunk/include/iprt/mangling.h
r100422 r100442 3528 3528 # define RTCrKeyQueryRsaModulus RT_MANGLER(RTCrKeyQueryRsaModulus) 3529 3529 # define RTCrKeyQueryRsaPrivateExponent RT_MANGLER(RTCrKeyQueryRsaPrivateExponent) 3530 # define RTCrKeyVerifyParameterCompatibility RT_MANGLER(RTCrKeyVerifyParameterCompatibility) 3530 3531 # define RTCrRc4 RT_MANGLER(RTCrRc4) 3531 3532 # define RTCrRc4SetKey RT_MANGLER(RTCrRc4SetKey) … … 3709 3710 # define RTCrPkixSignatureVerifyOctetString RT_MANGLER(RTCrPkixSignatureVerifyOctetString) 3710 3711 # define RTCrPkixGetCiperOidFromSignatureAlgorithm RT_MANGLER(RTCrPkixGetCiperOidFromSignatureAlgorithm) 3712 # define RTCrPkixGetCiperOidFromSignatureAlgorithmOid RT_MANGLER(RTCrPkixGetCiperOidFromSignatureAlgorithmOid) 3711 3713 # define RTCrPkixPubKeySignDigest RT_MANGLER(RTCrPkixPubKeySignDigest) 3712 3714 # define RTCrPkixPubKeyVerifySignature RT_MANGLER(RTCrPkixPubKeyVerifySignature) … … 3867 3869 # define RTCrX509AlgorithmIdentifier_Delete RT_MANGLER(RTCrX509AlgorithmIdentifier_Delete) 3868 3870 # define RTCrX509AlgorithmIdentifier_Enum RT_MANGLER(RTCrX509AlgorithmIdentifier_Enum) 3869 # define RTCrX509AlgorithmIdentifier_QueryDigestSize RT_MANGLER(RTCrX509AlgorithmIdentifier_QueryDigestSize) 3870 # define RTCrX509AlgorithmIdentifier_QueryDigestType RT_MANGLER(RTCrX509AlgorithmIdentifier_QueryDigestType) 3871 # define RTCrX509AlgorithmIdentifier_GetDigestSize RT_MANGLER(RTCrX509AlgorithmIdentifier_GetDigestSize) 3872 # define RTCrX509AlgorithmIdentifier_GetDigestType RT_MANGLER(RTCrX509AlgorithmIdentifier_GetDigestType) 3873 # define RTCrX509AlgorithmIdentifier_GetEncryptionOid RT_MANGLER(RTCrX509AlgorithmIdentifier_GetEncryptionOid) 3874 # define RTCrX509AlgorithmIdentifier_GetEncryptionOidFromOid RT_MANGLER(RTCrX509AlgorithmIdentifier_GetEncryptionOidFromOid) 3871 3875 # define RTCrX509AlgorithmIdentifiers_Compare RT_MANGLER(RTCrX509AlgorithmIdentifiers_Compare) 3872 3876 # define RTCrX509AlgorithmIdentifiers_Delete RT_MANGLER(RTCrX509AlgorithmIdentifiers_Delete)
Note:
See TracChangeset
for help on using the changeset viewer.