VirtualBox

Changeset 59689 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Feb 15, 2016 9:25:36 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
105546
Message:

IPRT: Added RTCrDigestGetAlgorithmOid, RTCrDigestTypeToAlgorithmOid, RTCrPkixPubKeyVerifySignedDigest, RTCrX509AlgorithmIdentifier_CombineEncryptionAndDigest, RTCrX509AlgorithmIdentifier_CombineEncryptionOidAndDigestOid, and RTCrX509AlgorithmIdentifier_CompareDigestOidAndEncryptedDigestOid.

Location:
trunk/include/iprt
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/crypto/digest.h

    r59620 r59689  
    182182RTDECL(bool) RTCrDigestIsFinalized(RTCRDIGEST hDigest);
    183183RTDECL(RTDIGESTTYPE) RTCrDigestGetType(RTCRDIGEST hDigest);
     184RTDECL(const char *) RTCrDigestGetAlgorithmOid(RTCRDIGEST hDigest);
     185
     186
     187/**
     188 * Translates an IPRT digest type value to an OID.
     189 *
     190 * @returns Dotted OID string on success, NULL if not translatable.
     191 * @param       enmDigestType       The IPRT digest type value to convert.
     192 */
     193RTDECL(const char *) RTCrDigestTypeToAlgorithmOid(RTDIGESTTYPE enmDigestType);
    184194
    185195/** @} */
  • trunk/include/iprt/crypto/pkix.h

    r59620 r59689  
    5353                                          PCRTASN1BITSTRING pSignatureValue, const void *pvData, size_t cbData,
    5454                                          PRTERRINFO pErrInfo);
     55
     56
     57/**
     58 * Verifies the signed digest (@a pvSignedDigest) against our digest (@a
     59 * hDigest) using the specfied public key (@a pPublicKey) and algorithm.
     60 *
     61 * @returns IPRT status code.
     62 * @param   pAlgorithm      The signature algorithm (digest w/ cipher).
     63 * @param   pParameters     Parameter to the public key algorithm. Optional.
     64 * @param   pPublicKey      The public key.
     65 * @param   pvSignedDigest  The signed digest.
     66 * @param   cbSignedDigest  The signed digest size.
     67 * @param   hDigest         The digest of the data to compare @a pvSignedDigest
     68 *                          with.
     69 * @param   pErrInfo        Where to return extended error info. Optional.
     70 */
     71RTDECL(int) RTCrPkixPubKeyVerifySignedDigest(PCRTASN1OBJID pAlgorithm, PCRTASN1DYNTYPE pParameters,
     72                                             PCRTASN1BITSTRING pPublicKey, void const *pvSignedDigest, size_t cbSignedDigest,
     73                                             RTCRDIGEST hDigest, PRTERRINFO pErrInfo);
    5574
    5675
  • trunk/include/iprt/crypto/x509.h

    r59663 r59689  
    9393RTDECL(int) RTCrX509AlgorithmIdentifier_CompareDigestAndEncryptedDigest(PCRTCRX509ALGORITHMIDENTIFIER pDigest,
    9494                                                                        PCRTCRX509ALGORITHMIDENTIFIER pEncryptedDigest);
     95/**
     96 * Compares a digest OID with an encrypted digest algorithm OID, checking if
     97 * they specify the same digest.
     98 *
     99 * @returns 0 if same digest, -1 if the digest is unknown, 1 if the encrypted
     100 *          digest does not match.
     101 * @param   pszDigestOid            The digest algorithm OID.
     102 * @param   pszEncryptedDigestOid   The encrypted digest algorithm OID.
     103 */
     104RTDECL(int) RTCrX509AlgorithmIdentifier_CompareDigestOidAndEncryptedDigestOid(const char *pszDigestOid,
     105                                                                              const char *pszEncryptedDigestOid);
     106
     107
     108/**
     109 * Combine the encryption algorithm with the digest algorithm.
     110 *
     111 * @returns OID of encrypted digest algorithm.
     112 * @param   pEncryption         The encryption algorithm.  Will work if this is
     113 *                              the OID of an encrypted digest algorithm too, as
     114 *                              long as it matches @a pDigest.
     115 * @param   pDigest             The digest algorithm.  Will work if this is the
     116 *                              OID of an encrypted digest algorithm too, as
     117 *                              long as it matches @a pEncryption.
     118 */
     119RTDECL(const char *) RTCrX509AlgorithmIdentifier_CombineEncryptionAndDigest(PCRTCRX509ALGORITHMIDENTIFIER pEncryption,
     120                                                                            PCRTCRX509ALGORITHMIDENTIFIER pDigest);
     121
     122/**
     123 * Combine the encryption algorithm OID with the digest algorithm OID.
     124 *
     125 * @returns OID of encrypted digest algorithm.
     126 * @param   pszEncryptionOid    The encryption algorithm.  Will work if this is
     127 *                              the OID of an encrypted digest algorithm too, as
     128 *                              long as it matches @a pszDigestOid.
     129 * @param   pszDigestOid        The digest algorithm.  Will work if this is the
     130 *                              OID of an encrypted digest algorithm too, as
     131 *                              long as it matches @a pszEncryptionOid.
     132 */
     133RTDECL(const char *) RTCrX509AlgorithmIdentifier_CombineEncryptionOidAndDigestOid(const char *pszEncryptionOid,
     134                                                                                  const char *pszDigestOid);
     135
    95136
    96137/** @name Typical Digest Algorithm OIDs.
  • trunk/include/iprt/mangling.h

    r59672 r59689  
    26922692# define RTCrDigestGetHashSize                          RT_MANGLER(RTCrDigestGetHashSize)
    26932693# define RTCrDigestGetType                              RT_MANGLER(RTCrDigestGetType)
     2694# define RTCrDigestGetAlgorithmOid                      RT_MANGLER(RTCrDigestGetAlgorithmOid)
    26942695# define RTCrDigestIsFinalized                          RT_MANGLER(RTCrDigestIsFinalized)
    26952696# define RTCrDigestMatch                                RT_MANGLER(RTCrDigestMatch)
     
    27052706# define RTCrDigestFindByObjIdString                    RT_MANGLER(RTCrDigestFindByObjIdString)
    27062707# define RTCrDigestFindByType                           RT_MANGLER(RTCrDigestFindByType)
     2708# define RTCrDigestTypeToAlgorithmOid                   RT_MANGLER(RTCrDigestTypeToAlgorithmOid)
    27072709# define RTCrRsaDigestInfo_DecodeAsn1                   RT_MANGLER(RTCrRsaDigestInfo_DecodeAsn1)
    27082710# define RTCrRsaOtherPrimeInfo_DecodeAsn1               RT_MANGLER(RTCrRsaOtherPrimeInfo_DecodeAsn1)
     
    28462848# define RTCrPkixGetCiperOidFromSignatureAlgorithm      RT_MANGLER(RTCrPkixGetCiperOidFromSignatureAlgorithm)
    28472849# define RTCrPkixPubKeyVerifySignature                  RT_MANGLER(RTCrPkixPubKeyVerifySignature)
     2850# define RTCrPkixPubKeyVerifySignedDigest               RT_MANGLER(RTCrPkixPubKeyVerifySignedDigest)
    28482851# define RTCrSpcAttributeTypeAndOptionalValue_DecodeAsn1 RT_MANGLER(RTCrSpcAttributeTypeAndOptionalValue_DecodeAsn1)
    28492852# define RTCrSpcIndirectDataContent_DecodeAsn1          RT_MANGLER(RTCrSpcIndirectDataContent_DecodeAsn1)
     
    29612964# define RTCrX509CertPathsValidateAll                   RT_MANGLER(RTCrX509CertPathsValidateAll)
    29622965# define RTCrX509CertPathsValidateOne                   RT_MANGLER(RTCrX509CertPathsValidateOne)
    2963 # define RTCrX509AlgorithmIdentifier_Compare            RT_MANGLER(RTCrX509AlgorithmIdentifier_Compare)
    2964 # define RTCrX509AlgorithmIdentifier_CompareDigestAndEncryptedDigest RT_MANGLER(RTCrX509AlgorithmIdentifier_CompareDigestAndEncryptedDigest)
     2966# define RTCrX509AlgorithmIdentifier_CombineEncryptionAndDigest             RT_MANGLER(RTCrX509AlgorithmIdentifier_CombineEncryptionAndDigest)
     2967# define RTCrX509AlgorithmIdentifier_CombineEncryptionOidAndDigestOid       RT_MANGLER(RTCrX509AlgorithmIdentifier_CombineEncryptionOidAndDigestOid)
     2968# define RTCrX509AlgorithmIdentifier_Compare                                RT_MANGLER(RTCrX509AlgorithmIdentifier_Compare)
     2969# define RTCrX509AlgorithmIdentifier_CompareDigestAndEncryptedDigest        RT_MANGLER(RTCrX509AlgorithmIdentifier_CompareDigestAndEncryptedDigest)
     2970# define RTCrX509AlgorithmIdentifier_CompareDigestOidAndEncryptedDigestOid  RT_MANGLER(RTCrX509AlgorithmIdentifier_CompareDigestOidAndEncryptedDigestOid)
    29652971# define RTCrX509AlgorithmIdentifier_CompareWithString  RT_MANGLER(RTCrX509AlgorithmIdentifier_CompareWithString)
    29662972# define RTCrX509AlgorithmIdentifier_Delete             RT_MANGLER(RTCrX509AlgorithmIdentifier_Delete)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette