({algorithm, curve})
| 145 | } |
| 146 | |
| 147 | function 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 | |
| 183 | function getKeyBitLength({bits, curve}) { |
| 184 | if (bits) { |
no outgoing calls
no test coverage detected