| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_CERT_X509_UTIL_MAC_H_ | 5 #ifndef NET_CERT_X509_UTIL_MAC_H_ |
| 6 #define NET_CERT_X509_UTIL_MAC_H_ | 6 #define NET_CERT_X509_UTIL_MAC_H_ |
| 7 | 7 |
| 8 #include <CoreFoundation/CFArray.h> | 8 #include <CoreFoundation/CFArray.h> |
| 9 #include <Security/Security.h> | 9 #include <Security/Security.h> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Creates a SecCertificate handle from the DER-encoded representation. | 38 // Creates a SecCertificate handle from the DER-encoded representation. |
| 39 // Returns NULL on failure. | 39 // Returns NULL on failure. |
| 40 NET_EXPORT base::ScopedCFTypeRef<SecCertificateRef> | 40 NET_EXPORT base::ScopedCFTypeRef<SecCertificateRef> |
| 41 CreateSecCertificateFromBytes(const uint8_t* data, size_t length); | 41 CreateSecCertificateFromBytes(const uint8_t* data, size_t length); |
| 42 | 42 |
| 43 // Returns a SecCertificate representing |cert|, or NULL on failure. | 43 // Returns a SecCertificate representing |cert|, or NULL on failure. |
| 44 NET_EXPORT base::ScopedCFTypeRef<SecCertificateRef> | 44 NET_EXPORT base::ScopedCFTypeRef<SecCertificateRef> |
| 45 CreateSecCertificateFromX509Certificate(const X509Certificate* cert); | 45 CreateSecCertificateFromX509Certificate(const X509Certificate* cert); |
| 46 | 46 |
| 47 // Returns a new CFMutableArrayRef containing this certificate and its | |
| 48 // intermediate certificates in the form expected by Security.framework | |
| 49 // and Keychain Services, or NULL on failure. | |
| 50 // The first item in the array will be this certificate, followed by its | |
| 51 // intermediates, if any. | |
| 52 NET_EXPORT base::ScopedCFTypeRef<CFMutableArrayRef> | |
| 53 CreateSecCertificateArrayForX509Certificate(X509Certificate* cert); | |
| 54 | |
| 55 // Creates an X509Certificate representing |sec_cert| with intermediates | 47 // Creates an X509Certificate representing |sec_cert| with intermediates |
| 56 // |sec_chain|. | 48 // |sec_chain|. |
| 57 NET_EXPORT scoped_refptr<X509Certificate> | 49 NET_EXPORT scoped_refptr<X509Certificate> |
| 58 CreateX509CertificateFromSecCertificate( | 50 CreateX509CertificateFromSecCertificate( |
| 59 SecCertificateRef sec_cert, | 51 SecCertificateRef sec_cert, |
| 60 const std::vector<SecCertificateRef>& sec_chain); | 52 const std::vector<SecCertificateRef>& sec_chain); |
| 61 | 53 |
| 62 // Returns true if the certificate is self-signed. | 54 // Returns true if the certificate is self-signed. |
| 63 NET_EXPORT bool IsSelfSigned(SecCertificateRef cert_handle); | 55 NET_EXPORT bool IsSelfSigned(SecCertificateRef cert_handle); |
| 64 | 56 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 CSSM_HANDLE cached_cert_handle_; | 171 CSSM_HANDLE cached_cert_handle_; |
| 180 }; | 172 }; |
| 181 | 173 |
| 182 #pragma clang diagnostic pop // "-Wdeprecated-declarations" | 174 #pragma clang diagnostic pop // "-Wdeprecated-declarations" |
| 183 | 175 |
| 184 } // namespace x509_util | 176 } // namespace x509_util |
| 185 | 177 |
| 186 } // namespace net | 178 } // namespace net |
| 187 | 179 |
| 188 #endif // NET_CERT_X509_UTIL_MAC_H_ | 180 #endif // NET_CERT_X509_UTIL_MAC_H_ |
| OLD | NEW |