If you have (x,y) ECDSA key components
(x: &str, y: &str)
| 149 | |
| 150 | /// If you have (x,y) ECDSA key components |
| 151 | pub fn from_ec_components(x: &str, y: &str) -> Result<Self> { |
| 152 | let x_cmp = b64_decode(x)?; |
| 153 | let y_cmp = b64_decode(y)?; |
| 154 | |
| 155 | let mut public_key = Vec::with_capacity(1 + x.len() + y.len()); |
| 156 | public_key.push(0x04); |
| 157 | public_key.extend_from_slice(&x_cmp); |
| 158 | public_key.extend_from_slice(&y_cmp); |
| 159 | |
| 160 | Ok(DecodingKey { |
| 161 | family: AlgorithmFamily::Ec, |
| 162 | kind: DecodingKeyKind::SecretOrDer(public_key), |
| 163 | }) |
| 164 | } |
| 165 | |
| 166 | /// If you have a EdDSA public key in PEM format, use this. |
| 167 | /// Only exists if the feature `use_pem` is enabled. |
nothing calls this directly
no test coverage detected