MCPcopy Index your code
hub / github.com/mailvelope/mailvelope / getAlgorithmString

Function getAlgorithmString

src/modules/key.js:147–181  ·  view source on GitHub ↗
({algorithm, curve})

Source from the content-addressed store, hash-verified

145}
146
147function getAlgorithmString({algorithm, curve}) {
148 let result = '';
149 switch (algorithm) {
150 case 'rsaEncryptSign':
151 result = 'RSA (Encrypt or Sign)';
152 break;
153 case 'rsaEncrypt':
154 result = 'RSA Encrypt-Only';
155 break;
156 case 'rsaSign':
157 result = 'RSA Sign-Only';
158 break;
159 case 'elgamal':
160 result = 'Elgamal (Encrypt-Only)';
161 break;
162 case 'dsa':
163 result = 'DSA (Digital Signature Algorithm)';
164 break;
165 case 'ecdh':
166 result = 'ECDH (Encrypt only)';
167 break;
168 case 'ecdsa':
169 result = 'ECDSA (Sign only)';
170 break;
171 case 'eddsa':
172 result = 'EdDSA (Sign only)';
173 break;
174 default:
175 result = 'UNKNOWN';
176 }
177 if (curve) {
178 result = `${result} - ${curve}`;
179 }
180 return result;
181}
182
183function getKeyBitLength({bits, curve}) {
184 if (bits) {

Callers 2

mapKeysFunction · 0.85
mapSubKeysFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected