| OLD | NEW |
| 1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
| 2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 4 | 4 |
| 5 /* | 5 /* |
| 6 * cert.h - public data structures and prototypes for the certificate library | 6 * cert.h - public data structures and prototypes for the certificate library |
| 7 * | 7 * |
| 8 * $Id$ | 8 * $Id$ |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 ** Create an X.500 style name using a NULL terminated list of RDN's. | 103 ** Create an X.500 style name using a NULL terminated list of RDN's. |
| 104 */ | 104 */ |
| 105 extern CERTName *CERT_CreateName(CERTRDN *rdn, ...); | 105 extern CERTName *CERT_CreateName(CERTRDN *rdn, ...); |
| 106 | 106 |
| 107 /* | 107 /* |
| 108 ** Make a copy of "src" storing it in "dest". Memory is allocated in | 108 ** Make a copy of "src" storing it in "dest". Memory is allocated in |
| 109 ** "dest" for each of the appropriate sub objects. Memory is not freed in | 109 ** "dest" for each of the appropriate sub objects. Memory is not freed in |
| 110 ** "dest" before allocation is done (use CERT_DestroyName(dest, PR_FALSE) to | 110 ** "dest" before allocation is done (use CERT_DestroyName(dest, PR_FALSE) to |
| 111 ** do that). | 111 ** do that). |
| 112 */ | 112 */ |
| 113 extern SECStatus CERT_CopyName(PLArenaPool *arena, CERTName *dest, CERTName *src
); | 113 extern SECStatus CERT_CopyName(PLArenaPool *arena, CERTName *dest, |
| 114 const CERTName *src); |
| 114 | 115 |
| 115 /* | 116 /* |
| 116 ** Destroy a Name object. | 117 ** Destroy a Name object. |
| 117 ** "name" the CERTName to destroy | 118 ** "name" the CERTName to destroy |
| 118 ** "freeit" if PR_TRUE then free the object as well as its sub-objects | 119 ** "freeit" if PR_TRUE then free the object as well as its sub-objects |
| 119 */ | 120 */ |
| 120 extern void CERT_DestroyName(CERTName *name); | 121 extern void CERT_DestroyName(CERTName *name); |
| 121 | 122 |
| 122 /* | 123 /* |
| 123 ** Add an RDN to a name. | 124 ** Add an RDN to a name. |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 ** Type CERTCertNicknames is being used because it's a convenient | 386 ** Type CERTCertNicknames is being used because it's a convenient |
| 386 ** data structure to carry a list of strings and its count. | 387 ** data structure to carry a list of strings and its count. |
| 387 */ | 388 */ |
| 388 extern CERTCertNicknames * | 389 extern CERTCertNicknames * |
| 389 CERT_GetValidDNSPatternsFromCert(CERTCertificate *cert); | 390 CERT_GetValidDNSPatternsFromCert(CERTCertificate *cert); |
| 390 | 391 |
| 391 /* | 392 /* |
| 392 ** Check the hostname to make sure that it matches the shexp that | 393 ** Check the hostname to make sure that it matches the shexp that |
| 393 ** is given in the common name of the certificate. | 394 ** is given in the common name of the certificate. |
| 394 */ | 395 */ |
| 395 extern SECStatus CERT_VerifyCertName(CERTCertificate *cert, const char *hostname
); | 396 extern SECStatus CERT_VerifyCertName(const CERTCertificate *cert, |
| 397 const char *hostname); |
| 396 | 398 |
| 397 /* | 399 /* |
| 398 ** Add a domain name to the list of names that the user has explicitly | 400 ** Add a domain name to the list of names that the user has explicitly |
| 399 ** allowed (despite cert name mismatches) for use with a server cert. | 401 ** allowed (despite cert name mismatches) for use with a server cert. |
| 400 */ | 402 */ |
| 401 extern SECStatus CERT_AddOKDomainName(CERTCertificate *cert, const char *hostnam
e); | 403 extern SECStatus CERT_AddOKDomainName(CERTCertificate *cert, const char *hostnam
e); |
| 402 | 404 |
| 403 /* | 405 /* |
| 404 ** Decode a DER encoded certificate into an CERTCertificate structure | 406 ** Decode a DER encoded certificate into an CERTCertificate structure |
| 405 ** "derSignedCert" is the DER encoded signed certificate | 407 ** "derSignedCert" is the DER encoded signed certificate |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 CERT_FindCertIssuer(CERTCertificate *cert, PRTime validTime, SECCertUsage usage)
; | 587 CERT_FindCertIssuer(CERTCertificate *cert, PRTime validTime, SECCertUsage usage)
; |
| 586 | 588 |
| 587 /* | 589 /* |
| 588 ** Check the validity times of a certificate vs. time 't', allowing | 590 ** Check the validity times of a certificate vs. time 't', allowing |
| 589 ** some slop for broken clocks and stuff. | 591 ** some slop for broken clocks and stuff. |
| 590 ** "cert" is the certificate to be checked | 592 ** "cert" is the certificate to be checked |
| 591 ** "t" is the time to check against | 593 ** "t" is the time to check against |
| 592 ** "allowOverride" if true then check to see if the invalidity has | 594 ** "allowOverride" if true then check to see if the invalidity has |
| 593 ** been overridden by the user. | 595 ** been overridden by the user. |
| 594 */ | 596 */ |
| 595 extern SECCertTimeValidity CERT_CheckCertValidTimes(CERTCertificate *cert, | 597 extern SECCertTimeValidity CERT_CheckCertValidTimes(const CERTCertificate *cert, |
| 596 PRTime t, | 598 PRTime t, |
| 597 PRBool allowOverride); | 599 PRBool allowOverride); |
| 598 | 600 |
| 599 /* | 601 /* |
| 600 ** WARNING - this function is deprecated, and will either go away or have | 602 ** WARNING - this function is deprecated, and will either go away or have |
| 601 ** a new API in the near future. | 603 ** a new API in the near future. |
| 602 ** | 604 ** |
| 603 ** Check the validity times of a certificate vs. the current time, allowing | 605 ** Check the validity times of a certificate vs. the current time, allowing |
| 604 ** some slop for broken clocks and stuff. | 606 ** some slop for broken clocks and stuff. |
| 605 ** "cert" is the certificate to be checked | 607 ** "cert" is the certificate to be checked |
| 606 */ | 608 */ |
| 607 extern SECStatus CERT_CertTimesValid(CERTCertificate *cert); | 609 extern SECStatus CERT_CertTimesValid(CERTCertificate *cert); |
| 608 | 610 |
| 609 /* | 611 /* |
| 610 ** Extract the validity times from a certificate | 612 ** Extract the validity times from a certificate |
| 611 ** "c" is the certificate | 613 ** "c" is the certificate |
| 612 ** "notBefore" is the start of the validity period | 614 ** "notBefore" is the start of the validity period |
| 613 ** "notAfter" is the end of the validity period | 615 ** "notAfter" is the end of the validity period |
| 614 */ | 616 */ |
| 615 extern SECStatus | 617 extern SECStatus |
| 616 CERT_GetCertTimes (CERTCertificate *c, PRTime *notBefore, PRTime *notAfter); | 618 CERT_GetCertTimes (const CERTCertificate *c, PRTime *notBefore, |
| 619 » » PRTime *notAfter); |
| 617 | 620 |
| 618 /* | 621 /* |
| 619 ** Extract the issuer and serial number from a certificate | 622 ** Extract the issuer and serial number from a certificate |
| 620 */ | 623 */ |
| 621 extern CERTIssuerAndSN *CERT_GetCertIssuerAndSN(PLArenaPool *, | 624 extern CERTIssuerAndSN *CERT_GetCertIssuerAndSN(PLArenaPool *, |
| 622 CERTCertificate *); | 625 CERTCertificate *); |
| 623 | 626 |
| 624 /* | 627 /* |
| 625 ** verify the signature of a signed data object with a given certificate | 628 ** verify the signature of a signed data object with a given certificate |
| 626 ** "sd" the signed data object to be verified | 629 ** "sd" the signed data object to be verified |
| 627 ** "cert" the certificate to use to check the signature | 630 ** "cert" the certificate to use to check the signature |
| 628 */ | 631 */ |
| 629 extern SECStatus CERT_VerifySignedData(CERTSignedData *sd, | 632 extern SECStatus CERT_VerifySignedData(CERTSignedData *sd, |
| 630 CERTCertificate *cert, | 633 CERTCertificate *cert, |
| 631 PRTime t, | 634 PRTime t, |
| 632 void *wincx); | 635 void *wincx); |
| 633 /* | 636 /* |
| 634 ** verify the signature of a signed data object with the given DER publickey | 637 ** verify the signature of a signed data object with the given DER publickey |
| 635 */ | 638 */ |
| 636 extern SECStatus | 639 extern SECStatus |
| 637 CERT_VerifySignedDataWithPublicKeyInfo(CERTSignedData *sd, | 640 CERT_VerifySignedDataWithPublicKeyInfo(CERTSignedData *sd, |
| 638 CERTSubjectPublicKeyInfo *pubKeyInfo, | 641 CERTSubjectPublicKeyInfo *pubKeyInfo, |
| 639 void *wincx); | 642 void *wincx); |
| 640 | 643 |
| 641 /* | 644 /* |
| 642 ** verify the signature of a signed data object with a SECKEYPublicKey. | 645 ** verify the signature of a signed data object with a SECKEYPublicKey. |
| 643 */ | 646 */ |
| 644 extern SECStatus | 647 extern SECStatus |
| 645 CERT_VerifySignedDataWithPublicKey(CERTSignedData *sd, | 648 CERT_VerifySignedDataWithPublicKey(const CERTSignedData *sd, |
| 646 SECKEYPublicKey *pubKey, void *wincx); | 649 SECKEYPublicKey *pubKey, void *wincx); |
| 647 | 650 |
| 648 /* | 651 /* |
| 649 ** NEW FUNCTIONS with new bit-field-FIELD SECCertificateUsage - please use | 652 ** NEW FUNCTIONS with new bit-field-FIELD SECCertificateUsage - please use |
| 650 ** verify a certificate by checking validity times against a certain time, | 653 ** verify a certificate by checking validity times against a certain time, |
| 651 ** that we trust the issuer, and that the signature on the certificate is | 654 ** that we trust the issuer, and that the signature on the certificate is |
| 652 ** valid. | 655 ** valid. |
| 653 ** "cert" the certificate to verify | 656 ** "cert" the certificate to verify |
| 654 ** "checkSig" only check signatures if true | 657 ** "checkSig" only check signatures if true |
| 655 */ | 658 */ |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 | 751 |
| 749 | 752 |
| 750 | 753 |
| 751 /* | 754 /* |
| 752 ** extract various element strings from a distinguished name. | 755 ** extract various element strings from a distinguished name. |
| 753 ** "name" the distinguished name | 756 ** "name" the distinguished name |
| 754 */ | 757 */ |
| 755 | 758 |
| 756 extern char *CERT_GetCertificateEmailAddress(CERTCertificate *cert); | 759 extern char *CERT_GetCertificateEmailAddress(CERTCertificate *cert); |
| 757 | 760 |
| 758 extern char *CERT_GetCertEmailAddress(CERTName *name); | 761 extern char *CERT_GetCertEmailAddress(const CERTName *name); |
| 759 | 762 |
| 760 extern const char * CERT_GetFirstEmailAddress(CERTCertificate * cert); | 763 extern const char * CERT_GetFirstEmailAddress(CERTCertificate * cert); |
| 761 | 764 |
| 762 extern const char * CERT_GetNextEmailAddress(CERTCertificate * cert, | 765 extern const char * CERT_GetNextEmailAddress(CERTCertificate * cert, |
| 763 const char * prev); | 766 const char * prev); |
| 764 | 767 |
| 765 /* The return value must be freed with PORT_Free. */ | 768 /* The return value must be freed with PORT_Free. */ |
| 766 extern char *CERT_GetCommonName(CERTName *name); | 769 extern char *CERT_GetCommonName(const CERTName *name); |
| 767 | 770 |
| 768 extern char *CERT_GetCountryName(CERTName *name); | 771 extern char *CERT_GetCountryName(const CERTName *name); |
| 769 | 772 |
| 770 extern char *CERT_GetLocalityName(CERTName *name); | 773 extern char *CERT_GetLocalityName(const CERTName *name); |
| 771 | 774 |
| 772 extern char *CERT_GetStateName(CERTName *name); | 775 extern char *CERT_GetStateName(const CERTName *name); |
| 773 | 776 |
| 774 extern char *CERT_GetOrgName(CERTName *name); | 777 extern char *CERT_GetOrgName(const CERTName *name); |
| 775 | 778 |
| 776 extern char *CERT_GetOrgUnitName(CERTName *name); | 779 extern char *CERT_GetOrgUnitName(const CERTName *name); |
| 777 | 780 |
| 778 extern char *CERT_GetDomainComponentName(CERTName *name); | 781 extern char *CERT_GetDomainComponentName(const CERTName *name); |
| 779 | 782 |
| 780 extern char *CERT_GetCertUid(CERTName *name); | 783 extern char *CERT_GetCertUid(const CERTName *name); |
| 781 | 784 |
| 782 /* manipulate the trust parameters of a certificate */ | 785 /* manipulate the trust parameters of a certificate */ |
| 783 | 786 |
| 784 extern SECStatus CERT_GetCertTrust(CERTCertificate *cert, CERTCertTrust *trust); | 787 extern SECStatus CERT_GetCertTrust(const CERTCertificate *cert, |
| 788 CERTCertTrust *trust); |
| 785 | 789 |
| 786 extern SECStatus | 790 extern SECStatus |
| 787 CERT_ChangeCertTrust (CERTCertDBHandle *handle, CERTCertificate *cert, | 791 CERT_ChangeCertTrust (CERTCertDBHandle *handle, CERTCertificate *cert, |
| 788 CERTCertTrust *trust); | 792 CERTCertTrust *trust); |
| 789 | 793 |
| 790 extern SECStatus | 794 extern SECStatus |
| 791 CERT_ChangeCertTrustByUsage(CERTCertDBHandle *certdb, CERTCertificate *cert, | 795 CERT_ChangeCertTrustByUsage(CERTCertDBHandle *certdb, CERTCertificate *cert, |
| 792 SECCertUsage usage); | 796 SECCertUsage usage); |
| 793 | 797 |
| 794 /************************************************************************* | 798 /************************************************************************* |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 */ | 885 */ |
| 882 extern SECStatus CERT_EncodeCRLDistributionPoints | 886 extern SECStatus CERT_EncodeCRLDistributionPoints |
| 883 (PLArenaPool *arena, CERTCrlDistributionPoints *value,SECItem *derValue); | 887 (PLArenaPool *arena, CERTCrlDistributionPoints *value,SECItem *derValue); |
| 884 | 888 |
| 885 /* | 889 /* |
| 886 ** Decodes a DER encoded basicConstaint extension value into a readable format | 890 ** Decodes a DER encoded basicConstaint extension value into a readable format |
| 887 ** value - decoded value | 891 ** value - decoded value |
| 888 ** encodedValue - value to decoded | 892 ** encodedValue - value to decoded |
| 889 */ | 893 */ |
| 890 extern SECStatus CERT_DecodeBasicConstraintValue | 894 extern SECStatus CERT_DecodeBasicConstraintValue |
| 891 (CERTBasicConstraints *value, SECItem *encodedValue); | 895 (CERTBasicConstraints *value, const SECItem *encodedValue); |
| 892 | 896 |
| 893 /* Decodes a DER encoded authorityKeyIdentifier extension value into a | 897 /* Decodes a DER encoded authorityKeyIdentifier extension value into a |
| 894 ** readable format. | 898 ** readable format. |
| 895 ** arena - where to allocate memory for the decoded value | 899 ** arena - where to allocate memory for the decoded value |
| 896 ** encodedValue - value to be decoded | 900 ** encodedValue - value to be decoded |
| 897 ** Returns a CERTAuthKeyID structure which contains the decoded value | 901 ** Returns a CERTAuthKeyID structure which contains the decoded value |
| 898 */ | 902 */ |
| 899 extern CERTAuthKeyID *CERT_DecodeAuthKeyID | 903 extern CERTAuthKeyID *CERT_DecodeAuthKeyID |
| 900 » » » (PLArenaPool *arena, SECItem *encodedValue); | 904 » » » (PLArenaPool *arena, const SECItem *encodedValue); |
| 901 | |
| 902 | 905 |
| 903 /* Decodes a DER encoded crlDistributionPoints extension value into a | 906 /* Decodes a DER encoded crlDistributionPoints extension value into a |
| 904 ** readable format. | 907 ** readable format. |
| 905 ** arena - where to allocate memory for the decoded value | 908 ** arena - where to allocate memory for the decoded value |
| 906 ** der - value to be decoded | 909 ** der - value to be decoded |
| 907 ** Returns a CERTCrlDistributionPoints structure which contains the | 910 ** Returns a CERTCrlDistributionPoints structure which contains the |
| 908 ** decoded value | 911 ** decoded value |
| 909 */ | 912 */ |
| 910 extern CERTCrlDistributionPoints * CERT_DecodeCRLDistributionPoints | 913 extern CERTCrlDistributionPoints * CERT_DecodeCRLDistributionPoints |
| 911 (PLArenaPool *arena, SECItem *der); | 914 (PLArenaPool *arena, SECItem *der); |
| 912 | 915 |
| 913 /* Extract certain name type from a generalName */ | 916 /* Extract certain name type from a generalName */ |
| 914 extern void *CERT_GetGeneralNameByType | 917 extern void *CERT_GetGeneralNameByType |
| 915 (CERTGeneralName *genNames, CERTGeneralNameType type, PRBool derFormat); | 918 (CERTGeneralName *genNames, CERTGeneralNameType type, PRBool derFormat); |
| 916 | 919 |
| 917 | 920 |
| 918 extern CERTOidSequence * | 921 extern CERTOidSequence * |
| 919 CERT_DecodeOidSequence(SECItem *seqItem); | 922 CERT_DecodeOidSequence(const SECItem *seqItem); |
| 920 | 923 |
| 921 | 924 |
| 922 | 925 |
| 923 | 926 |
| 924 /**************************************************************************** | 927 /**************************************************************************** |
| 925 * | 928 * |
| 926 * Find extension values of a certificate | 929 * Find extension values of a certificate |
| 927 * | 930 * |
| 928 ***************************************************************************/ | 931 ***************************************************************************/ |
| 929 | 932 |
| 930 extern SECStatus CERT_FindCertExtension | 933 extern SECStatus CERT_FindCertExtension |
| 931 (CERTCertificate *cert, int tag, SECItem *value); | 934 (const CERTCertificate *cert, int tag, SECItem *value); |
| 932 | 935 |
| 933 extern SECStatus CERT_FindNSCertTypeExtension | 936 extern SECStatus CERT_FindNSCertTypeExtension |
| 934 (CERTCertificate *cert, SECItem *value); | 937 (CERTCertificate *cert, SECItem *value); |
| 935 | 938 |
| 936 extern char * CERT_FindNSStringExtension (CERTCertificate *cert, int oidtag); | 939 extern char * CERT_FindNSStringExtension (CERTCertificate *cert, int oidtag); |
| 937 | 940 |
| 938 extern SECStatus CERT_FindIssuerCertExtension | 941 extern SECStatus CERT_FindIssuerCertExtension |
| 939 (CERTCertificate *cert, int tag, SECItem *value); | 942 (CERTCertificate *cert, int tag, SECItem *value); |
| 940 | 943 |
| 941 extern SECStatus CERT_FindCertExtensionByOID | 944 extern SECStatus CERT_FindCertExtensionByOID |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 ** Finds the crlNumber extension and decodes its value into 'value' | 1025 ** Finds the crlNumber extension and decodes its value into 'value' |
| 1023 */ | 1026 */ |
| 1024 extern SECStatus CERT_FindCRLNumberExten (PLArenaPool *arena, CERTCrl *crl, | 1027 extern SECStatus CERT_FindCRLNumberExten (PLArenaPool *arena, CERTCrl *crl, |
| 1025 SECItem *value); | 1028 SECItem *value); |
| 1026 | 1029 |
| 1027 extern SECStatus CERT_FindCRLEntryReasonExten (CERTCrlEntry *crlEntry, | 1030 extern SECStatus CERT_FindCRLEntryReasonExten (CERTCrlEntry *crlEntry, |
| 1028 CERTCRLEntryReasonCode *value); | 1031 CERTCRLEntryReasonCode *value); |
| 1029 | 1032 |
| 1030 extern void CERT_FreeNicknames(CERTCertNicknames *nicknames); | 1033 extern void CERT_FreeNicknames(CERTCertNicknames *nicknames); |
| 1031 | 1034 |
| 1032 extern PRBool CERT_CompareCerts(CERTCertificate *c1, CERTCertificate *c2); | 1035 extern PRBool CERT_CompareCerts(const CERTCertificate *c1, |
| 1036 const CERTCertificate *c2); |
| 1033 | 1037 |
| 1034 extern PRBool CERT_CompareCertsForRedirection(CERTCertificate *c1, | 1038 extern PRBool CERT_CompareCertsForRedirection(CERTCertificate *c1, |
| 1035 CERTCertificate *c2); | 1039 CERTCertificate *c2); |
| 1036 | 1040 |
| 1037 /* | 1041 /* |
| 1038 ** Generate an array of the Distinguished Names that the given cert database | 1042 ** Generate an array of the Distinguished Names that the given cert database |
| 1039 ** "trusts" | 1043 ** "trusts" |
| 1040 */ | 1044 */ |
| 1041 extern CERTDistNames *CERT_GetSSLCACerts(CERTCertDBHandle *handle); | 1045 extern CERTDistNames *CERT_GetSSLCACerts(CERTCertDBHandle *handle); |
| 1042 | 1046 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 /* | 1137 /* |
| 1134 * find the smime symmetric capabilities profile for a given cert | 1138 * find the smime symmetric capabilities profile for a given cert |
| 1135 */ | 1139 */ |
| 1136 SECItem * | 1140 SECItem * |
| 1137 CERT_FindSMimeProfile(CERTCertificate *cert); | 1141 CERT_FindSMimeProfile(CERTCertificate *cert); |
| 1138 | 1142 |
| 1139 SECStatus | 1143 SECStatus |
| 1140 CERT_AddNewCerts(CERTCertDBHandle *handle); | 1144 CERT_AddNewCerts(CERTCertDBHandle *handle); |
| 1141 | 1145 |
| 1142 CERTCertificatePolicies * | 1146 CERTCertificatePolicies * |
| 1143 CERT_DecodeCertificatePoliciesExtension(SECItem *extnValue); | 1147 CERT_DecodeCertificatePoliciesExtension(const SECItem *extnValue); |
| 1144 | 1148 |
| 1145 void | 1149 void |
| 1146 CERT_DestroyCertificatePoliciesExtension(CERTCertificatePolicies *policies); | 1150 CERT_DestroyCertificatePoliciesExtension(CERTCertificatePolicies *policies); |
| 1147 | 1151 |
| 1148 CERTCertificatePolicyMappings * | 1152 CERTCertificatePolicyMappings * |
| 1149 CERT_DecodePolicyMappingsExtension(SECItem *encodedCertPolicyMaps); | 1153 CERT_DecodePolicyMappingsExtension(SECItem *encodedCertPolicyMaps); |
| 1150 | 1154 |
| 1151 SECStatus | 1155 SECStatus |
| 1152 CERT_DestroyPolicyMappingsExtension(CERTCertificatePolicyMappings *mappings); | 1156 CERT_DestroyPolicyMappingsExtension(CERTCertificatePolicyMappings *mappings); |
| 1153 | 1157 |
| 1154 SECStatus | 1158 SECStatus |
| 1155 CERT_DecodePolicyConstraintsExtension( | 1159 CERT_DecodePolicyConstraintsExtension( |
| 1156 CERTCertificatePolicyConstraints *decodedValue, SECItem *encodedValue); | 1160 CERTCertificatePolicyConstraints *decodedValue, |
| 1161 const SECItem *encodedValue); |
| 1157 | 1162 |
| 1158 SECStatus CERT_DecodeInhibitAnyExtension | 1163 SECStatus CERT_DecodeInhibitAnyExtension |
| 1159 (CERTCertificateInhibitAny *decodedValue, SECItem *extnValue); | 1164 (CERTCertificateInhibitAny *decodedValue, SECItem *extnValue); |
| 1160 | 1165 |
| 1161 CERTUserNotice * | 1166 CERTUserNotice * |
| 1162 CERT_DecodeUserNotice(SECItem *noticeItem); | 1167 CERT_DecodeUserNotice(SECItem *noticeItem); |
| 1163 | 1168 |
| 1164 extern CERTGeneralName * | 1169 extern CERTGeneralName * |
| 1165 CERT_DecodeAltNameExtension(PLArenaPool *reqArena, SECItem *EncodedAltName); | 1170 CERT_DecodeAltNameExtension(PLArenaPool *reqArena, SECItem *EncodedAltName); |
| 1166 | 1171 |
| 1167 extern CERTNameConstraints * | 1172 extern CERTNameConstraints * |
| 1168 CERT_DecodeNameConstraintsExtension(PLArenaPool *arena, | 1173 CERT_DecodeNameConstraintsExtension(PLArenaPool *arena, |
| 1169 SECItem *encodedConstraints); | 1174 const SECItem *encodedConstraints); |
| 1170 | 1175 |
| 1171 /* returns addr of a NULL termainated array of pointers to CERTAuthInfoAccess */ | 1176 /* returns addr of a NULL termainated array of pointers to CERTAuthInfoAccess */ |
| 1172 extern CERTAuthInfoAccess ** | 1177 extern CERTAuthInfoAccess ** |
| 1173 CERT_DecodeAuthInfoAccessExtension(PLArenaPool *reqArena, | 1178 CERT_DecodeAuthInfoAccessExtension(PLArenaPool *reqArena, |
| 1174 SECItem *encodedExtension); | 1179 SECItem *encodedExtension); |
| 1175 | 1180 |
| 1176 extern CERTPrivKeyUsagePeriod * | 1181 extern CERTPrivKeyUsagePeriod * |
| 1177 CERT_DecodePrivKeyUsagePeriodExtension(PLArenaPool *arena, SECItem *extnValue); | 1182 CERT_DecodePrivKeyUsagePeriodExtension(PLArenaPool *arena, SECItem *extnValue); |
| 1178 | 1183 |
| 1179 extern CERTGeneralName * | 1184 extern CERTGeneralName * |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1251 CERTCertificate *certb, | 1256 CERTCertificate *certb, |
| 1252 void *arg); | 1257 void *arg); |
| 1253 | 1258 |
| 1254 SECStatus | 1259 SECStatus |
| 1255 CERT_CheckForEvilCert(CERTCertificate *cert); | 1260 CERT_CheckForEvilCert(CERTCertificate *cert); |
| 1256 | 1261 |
| 1257 CERTGeneralName * | 1262 CERTGeneralName * |
| 1258 CERT_GetCertificateNames(CERTCertificate *cert, PLArenaPool *arena); | 1263 CERT_GetCertificateNames(CERTCertificate *cert, PLArenaPool *arena); |
| 1259 | 1264 |
| 1260 CERTGeneralName * | 1265 CERTGeneralName * |
| 1261 CERT_GetConstrainedCertificateNames(CERTCertificate *cert, PLArenaPool *arena, | 1266 CERT_GetConstrainedCertificateNames(const CERTCertificate *cert, |
| 1267 PLArenaPool *arena, |
| 1262 PRBool includeSubjectCommonName); | 1268 PRBool includeSubjectCommonName); |
| 1263 | 1269 |
| 1264 /* | 1270 /* |
| 1265 * Creates or adds to a list of all certs with a give subject name, sorted by | 1271 * Creates or adds to a list of all certs with a give subject name, sorted by |
| 1266 * validity time, newest first. Invalid certs are considered older than | 1272 * validity time, newest first. Invalid certs are considered older than |
| 1267 * valid certs. If validOnly is set, do not include invalid certs on list. | 1273 * valid certs. If validOnly is set, do not include invalid certs on list. |
| 1268 */ | 1274 */ |
| 1269 CERTCertList * | 1275 CERTCertList * |
| 1270 CERT_CreateSubjectCertList(CERTCertList *certList, CERTCertDBHandle *handle, | 1276 CERT_CreateSubjectCertList(CERTCertList *certList, CERTCertDBHandle *handle, |
| 1271 » » » SECItem *name, PRTime sorttime, PRBool validOnly); | 1277 » » » const SECItem *name, PRTime sorttime, |
| 1278 » » » PRBool validOnly); |
| 1272 | 1279 |
| 1273 /* | 1280 /* |
| 1274 * remove certs from a list that don't have keyUsage and certType | 1281 * remove certs from a list that don't have keyUsage and certType |
| 1275 * that match the given usage. | 1282 * that match the given usage. |
| 1276 */ | 1283 */ |
| 1277 SECStatus | 1284 SECStatus |
| 1278 CERT_FilterCertListByUsage(CERTCertList *certList, SECCertUsage usage, | 1285 CERT_FilterCertListByUsage(CERTCertList *certList, SECCertUsage usage, |
| 1279 PRBool ca); | 1286 PRBool ca); |
| 1280 | 1287 |
| 1281 /* | 1288 /* |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1471 void | 1478 void |
| 1472 CERT_UnlockCertRefCount(CERTCertificate *cert); | 1479 CERT_UnlockCertRefCount(CERTCertificate *cert); |
| 1473 | 1480 |
| 1474 /* | 1481 /* |
| 1475 * Acquire the cert trust lock | 1482 * Acquire the cert trust lock |
| 1476 * There is currently one global lock for all certs, but I'm putting a cert | 1483 * There is currently one global lock for all certs, but I'm putting a cert |
| 1477 * arg here so that it will be easy to make it per-cert in the future if | 1484 * arg here so that it will be easy to make it per-cert in the future if |
| 1478 * that turns out to be necessary. | 1485 * that turns out to be necessary. |
| 1479 */ | 1486 */ |
| 1480 void | 1487 void |
| 1481 CERT_LockCertTrust(CERTCertificate *cert); | 1488 CERT_LockCertTrust(const CERTCertificate *cert); |
| 1482 | 1489 |
| 1483 /* | 1490 /* |
| 1484 * Free the cert trust lock | 1491 * Free the cert trust lock |
| 1485 */ | 1492 */ |
| 1486 void | 1493 void |
| 1487 CERT_UnlockCertTrust(CERTCertificate *cert); | 1494 CERT_UnlockCertTrust(const CERTCertificate *cert); |
| 1488 | 1495 |
| 1489 /* | 1496 /* |
| 1490 * Digest the cert's subject public key using the specified algorithm. | 1497 * Digest the cert's subject public key using the specified algorithm. |
| 1491 * The necessary storage for the digest data is allocated. If "fill" is | 1498 * The necessary storage for the digest data is allocated. If "fill" is |
| 1492 * non-null, the data is put there, otherwise a SECItem is allocated. | 1499 * non-null, the data is put there, otherwise a SECItem is allocated. |
| 1493 * Allocation from "arena" if it is non-null, heap otherwise. Any problem | 1500 * Allocation from "arena" if it is non-null, heap otherwise. Any problem |
| 1494 * results in a NULL being returned (and an appropriate error set). | 1501 * results in a NULL being returned (and an appropriate error set). |
| 1495 */ | 1502 */ |
| 1496 extern SECItem * | 1503 extern SECItem * |
| 1497 CERT_GetSPKIDigest(PLArenaPool *arena, const CERTCertificate *cert, | 1504 CERT_GetSPKIDigest(PLArenaPool *arena, const CERTCertificate *cert, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1518 CERT_CopyNameConstraint(PLArenaPool *arena, | 1525 CERT_CopyNameConstraint(PLArenaPool *arena, |
| 1519 CERTNameConstraint *dest, | 1526 CERTNameConstraint *dest, |
| 1520 CERTNameConstraint *src); | 1527 CERTNameConstraint *src); |
| 1521 | 1528 |
| 1522 /* | 1529 /* |
| 1523 * Verify name against all the constraints relevant to that type of | 1530 * Verify name against all the constraints relevant to that type of |
| 1524 * the name. | 1531 * the name. |
| 1525 */ | 1532 */ |
| 1526 extern SECStatus | 1533 extern SECStatus |
| 1527 CERT_CheckNameSpace(PLArenaPool *arena, | 1534 CERT_CheckNameSpace(PLArenaPool *arena, |
| 1528 » » CERTNameConstraints *constraints, | 1535 » » const CERTNameConstraints *constraints, |
| 1529 » » CERTGeneralName *currentName); | 1536 » » const CERTGeneralName *currentName); |
| 1530 | 1537 |
| 1531 /* | 1538 /* |
| 1532 * Extract and allocate the name constraints extension from the CA cert. | 1539 * Extract and allocate the name constraints extension from the CA cert. |
| 1533 */ | 1540 */ |
| 1534 extern SECStatus | 1541 extern SECStatus |
| 1535 CERT_FindNameConstraintsExten(PLArenaPool *arena, | 1542 CERT_FindNameConstraintsExten(PLArenaPool *arena, |
| 1536 CERTCertificate *cert, | 1543 CERTCertificate *cert, |
| 1537 CERTNameConstraints **constraints); | 1544 CERTNameConstraints **constraints); |
| 1538 | 1545 |
| 1539 /* | 1546 /* |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1641 /* | 1648 /* |
| 1642 * Destroy the arrays inside flags, | 1649 * Destroy the arrays inside flags, |
| 1643 * and destroy the object pointed to by flags, too. | 1650 * and destroy the object pointed to by flags, too. |
| 1644 */ | 1651 */ |
| 1645 extern void | 1652 extern void |
| 1646 CERT_DestroyCERTRevocationFlags(CERTRevocationFlags *flags); | 1653 CERT_DestroyCERTRevocationFlags(CERTRevocationFlags *flags); |
| 1647 | 1654 |
| 1648 SEC_END_PROTOS | 1655 SEC_END_PROTOS |
| 1649 | 1656 |
| 1650 #endif /* _CERT_H_ */ | 1657 #endif /* _CERT_H_ */ |
| OLD | NEW |