Chromium Code Reviews| Index: crypto/ec_signature_creator_nss.cc |
| diff --git a/crypto/ec_signature_creator_nss.cc b/crypto/ec_signature_creator_nss.cc |
| index 933f1cccf3d329c033d8240056133bedf9ce1696..c87ee478e9f62ba29c36e78aed4d85279a08fc26 100644 |
| --- a/crypto/ec_signature_creator_nss.cc |
| +++ b/crypto/ec_signature_creator_nss.cc |
| @@ -48,23 +48,32 @@ SECStatus SignData(SECItem* result, |
| return DSAU_EncodeDerSigWithLen(result, &sig, sig.len); |
| } |
| -} // namespace |
| +class ECSignatureCreatorNSS : public ECSignatureCreator { |
| + public: |
| + // Private constructor. Use the Create() method instead. |
| + explicit ECSignatureCreatorNSS(ECPrivateKey* key); |
|
Ryan Hamilton
2012/02/23 04:36:12
The comment says private, but the access modifier
mattm
2012/02/23 04:44:57
Ah, comment was moved over from the now-abstract E
|
| + virtual ~ECSignatureCreatorNSS(); |
| -// static |
| -ECSignatureCreator* ECSignatureCreator::Create(ECPrivateKey* key) { |
| - return new ECSignatureCreator(key); |
| -} |
| + virtual bool Sign(const uint8* data, |
| + int data_len, |
| + std::vector<uint8>* signature); |
| + |
| + private: |
| + ECPrivateKey* key_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ECSignatureCreatorNSS); |
| +}; |
| -ECSignatureCreator::ECSignatureCreator(ECPrivateKey* key) |
| +ECSignatureCreatorNSS::ECSignatureCreatorNSS(ECPrivateKey* key) |
| : key_(key) { |
| EnsureNSSInit(); |
| } |
| -ECSignatureCreator::~ECSignatureCreator() { } |
| +ECSignatureCreatorNSS::~ECSignatureCreatorNSS() { } |
| -bool ECSignatureCreator::Sign(const uint8* data, |
| - int data_len, |
| - std::vector<uint8>* signature) { |
| +bool ECSignatureCreatorNSS::Sign(const uint8* data, |
| + int data_len, |
| + std::vector<uint8>* signature) { |
| // Data to be signed |
| SECItem secret; |
| secret.type = siBuffer; |
| @@ -91,4 +100,11 @@ bool ECSignatureCreator::Sign(const uint8* data, |
| return true; |
| } |
| +} // namespace |
| + |
| +// static |
| +ECSignatureCreator* ECSignatureCreator::CreatePlatformImpl(ECPrivateKey* key) { |
| + return new ECSignatureCreatorNSS(key); |
| +} |
| + |
| } // namespace crypto |