summaryrefslogtreecommitdiff
path: root/chromium/content/child/webcrypto/nss/key_nss.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-06-18 14:10:49 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-06-18 13:53:24 +0000
commit813fbf95af77a531c57a8c497345ad2c61d475b3 (patch)
tree821b2c8de8365f21b6c9ba17a236fb3006a1d506 /chromium/content/child/webcrypto/nss/key_nss.h
parentaf6588f8d723931a298c995fa97259bb7f7deb55 (diff)
downloadqtwebengine-chromium-813fbf95af77a531c57a8c497345ad2c61d475b3.tar.gz
BASELINE: Update chromium to 44.0.2403.47
Change-Id: Ie056fedba95cf5e5c76b30c4b2c80fca4764aa2f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'chromium/content/child/webcrypto/nss/key_nss.h')
-rw-r--r--chromium/content/child/webcrypto/nss/key_nss.h109
1 files changed, 0 insertions, 109 deletions
diff --git a/chromium/content/child/webcrypto/nss/key_nss.h b/chromium/content/child/webcrypto/nss/key_nss.h
deleted file mode 100644
index 9eaf7c427b0..00000000000
--- a/chromium/content/child/webcrypto/nss/key_nss.h
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_CHILD_WEBCRYPTO_NSS_KEY_NSS_H_
-#define CONTENT_CHILD_WEBCRYPTO_NSS_KEY_NSS_H_
-
-#include <stdint.h>
-#include <vector>
-
-#include "crypto/scoped_nss_types.h"
-#include "third_party/WebKit/public/platform/WebCryptoKey.h"
-
-namespace content {
-
-namespace webcrypto {
-
-class CryptoData;
-class PrivateKeyNss;
-class PublicKeyNss;
-class SymKeyNss;
-
-// Base key class for all NSS keys, used to safely cast between types. Each key
-// maintains a copy of its serialized form in either 'raw', 'pkcs8', or 'spki'
-// format. This is to allow structured cloning of keys synchronously from the
-// target Blink thread without having to lock access to the key.
-class KeyNss : public blink::WebCryptoKeyHandle {
- public:
- explicit KeyNss(const CryptoData& serialized_key_data);
- ~KeyNss() override;
-
- virtual SymKeyNss* AsSymKey();
- virtual PublicKeyNss* AsPublicKey();
- virtual PrivateKeyNss* AsPrivateKey();
-
- const std::vector<uint8_t>& serialized_key_data() const {
- return serialized_key_data_;
- }
-
- private:
- const std::vector<uint8_t> serialized_key_data_;
-};
-
-class SymKeyNss : public KeyNss {
- public:
- ~SymKeyNss() override;
- SymKeyNss(crypto::ScopedPK11SymKey key, const CryptoData& raw_key_data);
-
- static SymKeyNss* Cast(const blink::WebCryptoKey& key);
-
- PK11SymKey* key() { return key_.get(); }
- SymKeyNss* AsSymKey() override;
-
- const std::vector<uint8_t>& raw_key_data() const {
- return serialized_key_data();
- }
-
- private:
- crypto::ScopedPK11SymKey key_;
-
- DISALLOW_COPY_AND_ASSIGN(SymKeyNss);
-};
-
-class PublicKeyNss : public KeyNss {
- public:
- ~PublicKeyNss() override;
- PublicKeyNss(crypto::ScopedSECKEYPublicKey key, const CryptoData& spki_data);
-
- static PublicKeyNss* Cast(const blink::WebCryptoKey& key);
-
- SECKEYPublicKey* key() { return key_.get(); }
- PublicKeyNss* AsPublicKey() override;
-
- const std::vector<uint8_t>& spki_data() const {
- return serialized_key_data();
- }
-
- private:
- crypto::ScopedSECKEYPublicKey key_;
-
- DISALLOW_COPY_AND_ASSIGN(PublicKeyNss);
-};
-
-class PrivateKeyNss : public KeyNss {
- public:
- ~PrivateKeyNss() override;
- PrivateKeyNss(crypto::ScopedSECKEYPrivateKey key,
- const CryptoData& pkcs8_data);
-
- static PrivateKeyNss* Cast(const blink::WebCryptoKey& key);
-
- SECKEYPrivateKey* key() { return key_.get(); }
- PrivateKeyNss* AsPrivateKey() override;
-
- const std::vector<uint8_t>& pkcs8_data() const {
- return serialized_key_data();
- }
-
- private:
- crypto::ScopedSECKEYPrivateKey key_;
-
- DISALLOW_COPY_AND_ASSIGN(PrivateKeyNss);
-};
-
-} // namespace webcrypto
-
-} // namespace content
-
-#endif // CONTENT_CHILD_WEBCRYPTO_NSS_KEY_NSS_H_