| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -98,37 +98,6 @@ Maybe<void> DsaKeyGenTraits::AdditionalConfig( | |||
| 98 | 98 | return JustVoid(); | |
| 99 | 99 | } | |
| 100 | 100 | ||
| 101 | - Maybe<void> DSAKeyExportTraits::AdditionalConfig( | ||
| 102 | - const FunctionCallbackInfo<Value>& args, | ||
| 103 | - unsigned int offset, | ||
| 104 | - DSAKeyExportConfig* params) { | ||
| 105 | - return JustVoid(); | ||
| 106 | - } | ||
| 107 | - | ||
| 108 | - WebCryptoKeyExportStatus DSAKeyExportTraits::DoExport( | ||
| 109 | - const KeyObjectData& key_data, | ||
| 110 | - WebCryptoKeyFormat format, | ||
| 111 | - const DSAKeyExportConfig& params, | ||
| 112 | - ByteSource* out) { | ||
| 113 | - CHECK_NE(key_data.GetKeyType(), kKeyTypeSecret); | ||
| 114 | - | ||
| 115 | - switch (format) { | ||
| 116 | - case kWebCryptoKeyFormatRaw: | ||
| 117 | - // Not supported for RSA keys of either type | ||
| 118 | - return WebCryptoKeyExportStatus::FAILED; | ||
| 119 | - case kWebCryptoKeyFormatPKCS8: | ||
| 120 | - if (key_data.GetKeyType() != kKeyTypePrivate) | ||
| 121 | - return WebCryptoKeyExportStatus::INVALID_KEY_TYPE; | ||
| 122 | - return PKEY_PKCS8_Export(key_data, out); | ||
| 123 | - case kWebCryptoKeyFormatSPKI: | ||
| 124 | - if (key_data.GetKeyType() != kKeyTypePublic) | ||
| 125 | - return WebCryptoKeyExportStatus::INVALID_KEY_TYPE; | ||
| 126 | - return PKEY_SPKI_Export(key_data, out); | ||
| 127 | - default: | ||
| 128 | - UNREACHABLE(); | ||
| 129 | - } | ||
| 130 | - } | ||
| 131 | - | ||
| 132 | 101 | Maybe<void> GetDsaKeyDetail(Environment* env, | |
| 133 | 102 | const KeyObjectData& key, | |
| 134 | 103 | Local<Object> target) { | |
@@ -169,12 +138,10 @@ Maybe<void> GetDsaKeyDetail(Environment* env, | |||
| 169 | 138 | namespace DSAAlg { | |
| 170 | 139 | void Initialize(Environment* env, Local<Object> target) { | |
| 171 | 140 | DsaKeyPairGenJob::Initialize(env, target); | |
| 172 | - DSAKeyExportJob::Initialize(env, target); | ||
| 173 | 141 | } | |
| 174 | 142 | ||
| 175 | 143 | void RegisterExternalReferences(ExternalReferenceRegistry* registry) { | |
| 176 | 144 | DsaKeyPairGenJob::RegisterExternalReferences(registry); | |
| 177 | - DSAKeyExportJob::RegisterExternalReferences(registry); | ||
| 178 | 145 | } | |
| 179 | 146 | } // namespace DSAAlg | |
| 180 | 147 | } // namespace crypto | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,29 +37,6 @@ struct DsaKeyGenTraits final { | |||
| 37 | 37 | ||
| 38 | 38 | using DsaKeyPairGenJob = KeyGenJob<KeyPairGenTraits<DsaKeyGenTraits>>; | |
| 39 | 39 | ||
| 40 | - struct DSAKeyExportConfig final : public MemoryRetainer { | ||
| 41 | - SET_NO_MEMORY_INFO() | ||
| 42 | - SET_MEMORY_INFO_NAME(DSAKeyExportConfig) | ||
| 43 | - SET_SELF_SIZE(DSAKeyExportConfig) | ||
| 44 | - }; | ||
| 45 | - | ||
| 46 | - struct DSAKeyExportTraits final { | ||
| 47 | - static constexpr const char* JobName = "DSAKeyExportJob"; | ||
| 48 | - using AdditionalParameters = DSAKeyExportConfig; | ||
| 49 | - | ||
| 50 | - static v8::Maybe<void> AdditionalConfig( | ||
| 51 | - const v8::FunctionCallbackInfo<v8::Value>& args, | ||
| 52 | - unsigned int offset, | ||
| 53 | - DSAKeyExportConfig* config); | ||
| 54 | - | ||
| 55 | - static WebCryptoKeyExportStatus DoExport(const KeyObjectData& key_data, | ||
| 56 | - WebCryptoKeyFormat format, | ||
| 57 | - const DSAKeyExportConfig& params, | ||
| 58 | - ByteSource* out); | ||
| 59 | - }; | ||
| 60 | - | ||
| 61 | - using DSAKeyExportJob = KeyExportJob<DSAKeyExportTraits>; | ||
| 62 | - | ||
| 63 | 40 | v8::Maybe<void> GetDsaKeyDetail(Environment* env, | |
| 64 | 41 | const KeyObjectData& key, | |
| 65 | 42 | v8::Local<v8::Object> target); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments