| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 BASE_CRYPTO_RSA_PRIVATE_KEY_H_ | 5 #ifndef BASE_CRYPTO_RSA_PRIVATE_KEY_H_ |
| 6 #define BASE_CRYPTO_RSA_PRIVATE_KEY_H_ | 6 #define BASE_CRYPTO_RSA_PRIVATE_KEY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 static const uint8 kBitStringTag = 0x03; | 42 static const uint8 kBitStringTag = 0x03; |
| 43 static const uint8 kIntegerTag = 0x02; | 43 static const uint8 kIntegerTag = 0x02; |
| 44 static const uint8 kNullTag = 0x05; | 44 static const uint8 kNullTag = 0x05; |
| 45 static const uint8 kOctetStringTag = 0x04; | 45 static const uint8 kOctetStringTag = 0x04; |
| 46 static const uint8 kSequenceTag = 0x30; | 46 static const uint8 kSequenceTag = 0x30; |
| 47 | 47 |
| 48 // |big_endian| here specifies the byte-significance of the integer components | 48 // |big_endian| here specifies the byte-significance of the integer components |
| 49 // that will be parsed & serialized (modulus(), etc...) during Import(), | 49 // that will be parsed & serialized (modulus(), etc...) during Import(), |
| 50 // Export() and ExportPublicKeyInfo() -- not the ASN.1 DER encoding of the | 50 // Export() and ExportPublicKeyInfo() -- not the ASN.1 DER encoding of the |
| 51 // PrivateKeyInfo/PublicKeyInfo (which is always big-endian). | 51 // PrivateKeyInfo/PublicKeyInfo (which is always big-endian). |
| 52 explicit PrivateKeyInfoCodec(bool big_endian) : big_endian_(big_endian) {} | 52 explicit PrivateKeyInfoCodec(bool big_endian); |
| 53 |
| 54 ~PrivateKeyInfoCodec(); |
| 53 | 55 |
| 54 // Exports the contents of the integer components to the ASN.1 DER encoding | 56 // Exports the contents of the integer components to the ASN.1 DER encoding |
| 55 // of the PrivateKeyInfo structure to |output|. | 57 // of the PrivateKeyInfo structure to |output|. |
| 56 bool Export(std::vector<uint8>* output); | 58 bool Export(std::vector<uint8>* output); |
| 57 | 59 |
| 58 // Exports the contents of the integer components to the ASN.1 DER encoding | 60 // Exports the contents of the integer components to the ASN.1 DER encoding |
| 59 // of the PublicKeyInfo structure to |output|. | 61 // of the PublicKeyInfo structure to |output|. |
| 60 bool ExportPublicKeyInfo(std::vector<uint8>* output); | 62 bool ExportPublicKeyInfo(std::vector<uint8>* output); |
| 61 | 63 |
| 62 // Parses the ASN.1 DER encoding of the PrivateKeyInfo structure in |input| | 64 // Parses the ASN.1 DER encoding of the PrivateKeyInfo structure in |input| |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 #elif defined(OS_MACOSX) | 249 #elif defined(OS_MACOSX) |
| 248 CSSM_KEY key_; | 250 CSSM_KEY key_; |
| 249 #endif | 251 #endif |
| 250 | 252 |
| 251 DISALLOW_COPY_AND_ASSIGN(RSAPrivateKey); | 253 DISALLOW_COPY_AND_ASSIGN(RSAPrivateKey); |
| 252 }; | 254 }; |
| 253 | 255 |
| 254 } // namespace base | 256 } // namespace base |
| 255 | 257 |
| 256 #endif // BASE_CRYPTO_RSA_PRIVATE_KEY_H_ | 258 #endif // BASE_CRYPTO_RSA_PRIVATE_KEY_H_ |
| OLD | NEW |