| 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_ASN1_UTIL_H_ | 5 #ifndef NET_CERT_ASN1_UTIL_H_ |
| 6 #define NET_CERT_ASN1_UTIL_H_ | 6 #define NET_CERT_ASN1_UTIL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // On successful return: | 39 // On successful return: |
| 40 // |in| is advanced over the element | 40 // |in| is advanced over the element |
| 41 // |out| contains the element, including the tag and length bytes. | 41 // |out| contains the element, including the tag and length bytes. |
| 42 // |out_header_len| contains the length of the tag and length bytes in |out|. | 42 // |out_header_len| contains the length of the tag and length bytes in |out|. |
| 43 // | 43 // |
| 44 // If |tag_value & kOptional| is true then *out_header_len can be zero after a | 44 // If |tag_value & kOptional| is true then *out_header_len can be zero after a |
| 45 // true return value if the element was not found. | 45 // true return value if the element was not found. |
| 46 bool ParseElement(base::StringPiece* in, | 46 bool ParseElement(base::StringPiece* in, |
| 47 unsigned tag_value, | 47 unsigned tag_value, |
| 48 base::StringPiece* out, | 48 base::StringPiece* out, |
| 49 unsigned *out_header_len); | 49 unsigned* out_header_len); |
| 50 | 50 |
| 51 // GetElement performs the same actions as ParseElement, except that the header | 51 // GetElement performs the same actions as ParseElement, except that the header |
| 52 // bytes are not included in the output. | 52 // bytes are not included in the output. |
| 53 // | 53 // |
| 54 // If |tag_value & kOptional| is true then this function cannot distinguish | 54 // If |tag_value & kOptional| is true then this function cannot distinguish |
| 55 // between a missing optional element and an empty one. | 55 // between a missing optional element and an empty one. |
| 56 bool GetElement(base::StringPiece* in, | 56 bool GetElement(base::StringPiece* in, |
| 57 unsigned tag_value, | 57 unsigned tag_value, |
| 58 base::StringPiece* out); | 58 base::StringPiece* out); |
| 59 | 59 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 79 // | 79 // |
| 80 // CRLs that use an alternative issuer are also omitted. | 80 // CRLs that use an alternative issuer are also omitted. |
| 81 // | 81 // |
| 82 // The nested set of GeneralNames is flattened into a single list because | 82 // The nested set of GeneralNames is flattened into a single list because |
| 83 // having several CRLs with one location is equivalent to having one CRL with | 83 // having several CRLs with one location is equivalent to having one CRL with |
| 84 // several locations as far as a CRL filter is concerned. | 84 // several locations as far as a CRL filter is concerned. |
| 85 NET_EXPORT_PRIVATE bool ExtractCRLURLsFromDERCert( | 85 NET_EXPORT_PRIVATE bool ExtractCRLURLsFromDERCert( |
| 86 base::StringPiece cert, | 86 base::StringPiece cert, |
| 87 std::vector<base::StringPiece>* urls_out); | 87 std::vector<base::StringPiece>* urls_out); |
| 88 | 88 |
| 89 } // namespace asn1 | 89 } // namespace asn1 |
| 90 | 90 |
| 91 } // namespace net | 91 } // namespace net |
| 92 | 92 |
| 93 #endif // NET_CERT_ASN1_UTIL_H_ | 93 #endif // NET_CERT_ASN1_UTIL_H_ |
| OLD | NEW |