OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 return CryptoOperation::create(algorithm, opImpl.get()); | 70 return CryptoOperation::create(algorithm, opImpl.get()); |
71 } | 71 } |
72 | 72 |
73 } // namespace | 73 } // namespace |
74 | 74 |
75 SubtleCrypto::SubtleCrypto() | 75 SubtleCrypto::SubtleCrypto() |
76 { | 76 { |
77 ScriptWrappable::init(this); | 77 ScriptWrappable::init(this); |
78 } | 78 } |
79 | 79 |
80 PassRefPtr<CryptoOperation> SubtleCrypto::encrypt(const Dictionary& rawAlgorithm
, Key*, ExceptionState& es) | 80 PassRefPtr<CryptoOperation> SubtleCrypto::encrypt(const Dictionary& rawAlgorithm
, ExceptionState& es) |
81 { | 81 { |
82 return dummyOperation(rawAlgorithm, Encrypt, es); | 82 return dummyOperation(rawAlgorithm, Encrypt, es); |
83 } | 83 } |
84 | 84 |
85 PassRefPtr<CryptoOperation> SubtleCrypto::decrypt(const Dictionary& rawAlgorithm
, Key*, ExceptionState& es) | 85 PassRefPtr<CryptoOperation> SubtleCrypto::decrypt(const Dictionary& rawAlgorithm
, ExceptionState& es) |
86 { | 86 { |
87 return dummyOperation(rawAlgorithm, Decrypt, es); | 87 return dummyOperation(rawAlgorithm, Decrypt, es); |
88 } | 88 } |
89 | 89 |
90 PassRefPtr<CryptoOperation> SubtleCrypto::sign(const Dictionary& rawAlgorithm, K
ey*, ExceptionState& es) | 90 PassRefPtr<CryptoOperation> SubtleCrypto::sign(const Dictionary& rawAlgorithm, E
xceptionState& es) |
91 { | 91 { |
92 return dummyOperation(rawAlgorithm, Sign, es); | 92 return dummyOperation(rawAlgorithm, Sign, es); |
93 } | 93 } |
94 | 94 |
95 PassRefPtr<CryptoOperation> SubtleCrypto::verifySignature(const Dictionary& rawA
lgorithm, Key*, ExceptionState& es) | 95 PassRefPtr<CryptoOperation> SubtleCrypto::verifySignature(const Dictionary& rawA
lgorithm, ExceptionState& es) |
96 { | 96 { |
97 return dummyOperation(rawAlgorithm, Verify, es); | 97 return dummyOperation(rawAlgorithm, Verify, es); |
98 } | 98 } |
99 | 99 |
100 PassRefPtr<CryptoOperation> SubtleCrypto::digest(const Dictionary& rawAlgorithm,
ExceptionState& es) | 100 PassRefPtr<CryptoOperation> SubtleCrypto::digest(const Dictionary& rawAlgorithm,
ExceptionState& es) |
101 { | 101 { |
102 WebKit::WebCrypto* platformCrypto = WebKit::Platform::current()->crypto(); | 102 WebKit::WebCrypto* platformCrypto = WebKit::Platform::current()->crypto(); |
103 if (!platformCrypto) { | 103 if (!platformCrypto) { |
104 es.throwDOMException(NotSupportedError); | 104 es.throwDOMException(NotSupportedError); |
105 return 0; | 105 return 0; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 148 |
149 const unsigned char* keyDataBytes = static_cast<unsigned char*>(keyData->bas
eAddress()); | 149 const unsigned char* keyDataBytes = static_cast<unsigned char*>(keyData->bas
eAddress()); |
150 | 150 |
151 RefPtr<KeyOperation> keyOp = KeyOperation::create(); | 151 RefPtr<KeyOperation> keyOp = KeyOperation::create(); |
152 WebKit::WebCryptoKeyOperationResult result(keyOp.get()); | 152 WebKit::WebCryptoKeyOperationResult result(keyOp.get()); |
153 platformCrypto->importKey(format, keyDataBytes, keyData->byteLength(), algor
ithm, extractable, keyUsages, result); | 153 platformCrypto->importKey(format, keyDataBytes, keyData->byteLength(), algor
ithm, extractable, keyUsages, result); |
154 return keyOp->returnValue(es); | 154 return keyOp->returnValue(es); |
155 } | 155 } |
156 | 156 |
157 } // namespace WebCore | 157 } // namespace WebCore |
OLD | NEW |