Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Side by Side Diff: public/platform/WebCryptoAlgorithm.h

Issue 26426002: [webcrypto] Add parameters for AES-GCM and RSA-OAEP to blink API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 enum WebCryptoAlgorithmId { 43 enum WebCryptoAlgorithmId {
44 WebCryptoAlgorithmIdAesCbc, 44 WebCryptoAlgorithmIdAesCbc,
45 WebCryptoAlgorithmIdHmac, 45 WebCryptoAlgorithmIdHmac,
46 WebCryptoAlgorithmIdRsaSsaPkcs1v1_5, 46 WebCryptoAlgorithmIdRsaSsaPkcs1v1_5,
47 WebCryptoAlgorithmIdRsaEsPkcs1v1_5, 47 WebCryptoAlgorithmIdRsaEsPkcs1v1_5,
48 WebCryptoAlgorithmIdSha1, 48 WebCryptoAlgorithmIdSha1,
49 WebCryptoAlgorithmIdSha224, 49 WebCryptoAlgorithmIdSha224,
50 WebCryptoAlgorithmIdSha256, 50 WebCryptoAlgorithmIdSha256,
51 WebCryptoAlgorithmIdSha384, 51 WebCryptoAlgorithmIdSha384,
52 WebCryptoAlgorithmIdSha512, 52 WebCryptoAlgorithmIdSha512,
53 WebCryptoAlgorithmIdAesGcm,
54 WebCryptoAlgorithmIdRsaOaep,
53 #if BLINK_IMPLEMENTATION 55 #if BLINK_IMPLEMENTATION
54 NumberOfWebCryptoAlgorithmId, 56 NumberOfWebCryptoAlgorithmId,
55 #endif 57 #endif
56 }; 58 };
57 59
58 enum WebCryptoAlgorithmParamsType { 60 enum WebCryptoAlgorithmParamsType {
59 WebCryptoAlgorithmParamsTypeNone, 61 WebCryptoAlgorithmParamsTypeNone,
60 WebCryptoAlgorithmParamsTypeAesCbcParams, 62 WebCryptoAlgorithmParamsTypeAesCbcParams,
61 WebCryptoAlgorithmParamsTypeAesKeyGenParams, 63 WebCryptoAlgorithmParamsTypeAesKeyGenParams,
62 WebCryptoAlgorithmParamsTypeHmacParams, 64 WebCryptoAlgorithmParamsTypeHmacParams,
63 WebCryptoAlgorithmParamsTypeHmacKeyParams, 65 WebCryptoAlgorithmParamsTypeHmacKeyParams,
64 WebCryptoAlgorithmParamsTypeRsaSsaParams, 66 WebCryptoAlgorithmParamsTypeRsaSsaParams,
65 WebCryptoAlgorithmParamsTypeRsaKeyGenParams, 67 WebCryptoAlgorithmParamsTypeRsaKeyGenParams,
68 WebCryptoAlgorithmParamsTypeAesGcmParams,
69 WebCryptoAlgorithmParamsTypeRsaOaepParams,
66 }; 70 };
67 71
68 class WebCryptoAesCbcParams; 72 class WebCryptoAesCbcParams;
69 class WebCryptoAesKeyGenParams; 73 class WebCryptoAesKeyGenParams;
70 class WebCryptoHmacParams; 74 class WebCryptoHmacParams;
71 class WebCryptoHmacKeyParams; 75 class WebCryptoHmacKeyParams;
72 class WebCryptoRsaSsaParams; 76 class WebCryptoRsaSsaParams;
73 class WebCryptoRsaKeyGenParams; 77 class WebCryptoRsaKeyGenParams;
78 class WebCryptoAesGcmParams;
79 class WebCryptoRsaOaepParams;
74 80
75 class WebCryptoAlgorithmParams; 81 class WebCryptoAlgorithmParams;
76 class WebCryptoAlgorithmPrivate; 82 class WebCryptoAlgorithmPrivate;
77 83
78 // The WebCryptoAlgorithm represents a normalized algorithm and its parameters. 84 // The WebCryptoAlgorithm represents a normalized algorithm and its parameters.
79 // * Immutable 85 // * Immutable
80 // * Threadsafe 86 // * Threadsafe
81 // * Copiable (cheaply) 87 // * Copiable (cheaply)
82 class WebCryptoAlgorithm { 88 class WebCryptoAlgorithm {
83 public: 89 public:
(...skipping 18 matching lines...) Expand all
102 BLINK_EXPORT WebCryptoAlgorithmParamsType paramsType() const; 108 BLINK_EXPORT WebCryptoAlgorithmParamsType paramsType() const;
103 109
104 // Retrieves the type-specific parameters. The algorithm contains at most 1 110 // Retrieves the type-specific parameters. The algorithm contains at most 1
105 // type of parameters. Retrieving an invalid parameter will return 0. 111 // type of parameters. Retrieving an invalid parameter will return 0.
106 BLINK_EXPORT const WebCryptoAesCbcParams* aesCbcParams() const; 112 BLINK_EXPORT const WebCryptoAesCbcParams* aesCbcParams() const;
107 BLINK_EXPORT const WebCryptoAesKeyGenParams* aesKeyGenParams() const; 113 BLINK_EXPORT const WebCryptoAesKeyGenParams* aesKeyGenParams() const;
108 BLINK_EXPORT const WebCryptoHmacParams* hmacParams() const; 114 BLINK_EXPORT const WebCryptoHmacParams* hmacParams() const;
109 BLINK_EXPORT const WebCryptoHmacKeyParams* hmacKeyParams() const; 115 BLINK_EXPORT const WebCryptoHmacKeyParams* hmacKeyParams() const;
110 BLINK_EXPORT const WebCryptoRsaSsaParams* rsaSsaParams() const; 116 BLINK_EXPORT const WebCryptoRsaSsaParams* rsaSsaParams() const;
111 BLINK_EXPORT const WebCryptoRsaKeyGenParams* rsaKeyGenParams() const; 117 BLINK_EXPORT const WebCryptoRsaKeyGenParams* rsaKeyGenParams() const;
118 BLINK_EXPORT const WebCryptoAesGcmParams* aesGcmParams() const;
119 BLINK_EXPORT const WebCryptoRsaOaepParams* rsaOaepParams() const;
112 120
113 private: 121 private:
114 BLINK_EXPORT void assign(const WebCryptoAlgorithm& other); 122 BLINK_EXPORT void assign(const WebCryptoAlgorithm& other);
115 BLINK_EXPORT void reset(); 123 BLINK_EXPORT void reset();
116 124
117 WebPrivatePtr<WebCryptoAlgorithmPrivate> m_private; 125 WebPrivatePtr<WebCryptoAlgorithmPrivate> m_private;
118 }; 126 };
119 127
120 } // namespace WebKit 128 } // namespace WebKit
121 129
122 #endif 130 #endif
OLDNEW
« no previous file with comments | « Source/modules/crypto/NormalizeAlgorithm.cpp ('k') | public/platform/WebCryptoAlgorithmParams.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698