public void FromPem_PublicKey(string pem) { var key = RsaJwk.FromPem(pem); AssertKeyEquals(ToPublic(DiminishedDPParameters), key.ExportParameters()); Assert.False(key.HasPrivateKey); }
public void FromPem_UnexpectedKeyType_ThrowArgumentException() { string pem = @" -----BEGIN PRIVATE KEY----- MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgcKEsLbFoRe1W/2jP whpHKz8E19aFG/Y0ny19WzRSs4qhRANCAASBAezkdGSm6tcM9ppuK9PYhpGjJi0i y6T3Y16v8maAqNihK6YdWZI19n2ctNWPF4PTykPnjwpauqYkB5k2wMOp -----END PRIVATE KEY-----"; Assert.Throws <InvalidOperationException>(() => RsaJwk.FromPem(pem)); }