fork download
  1. using System;
  2. using System.Security.Cryptography;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8.  
  9. String publicKeyBase64 = "MIIEgTCCBCigAwIBAgIID0OBm7t6lEwwCgYIKoZIzj0EAwIwgYAxNDAyBgNVBAMMK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0gRzIxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0yNTAzMjQwMzExMjlaFw0yNzA0MjMwMzExMjhaMIGzMSkwJwYKCZImiZPyLGQBAQwZbWVyY2hhbnQuY29tLnNpYS5jcHAuZGV2MjE/MD0GA1UEAww2QXBwbGUgUGF5IFBheW1lbnQgUHJvY2Vzc2luZzptZXJjaGFudC5jb20uc2lhLmNwcC5kZXYyMRMwEQYDVQQLDApOV0haTTgyV0VNMSMwIQYDVQQKDBpTaW5nYXBvcmUgQWlybGluZXMgTGltaXRlZDELMAkGA1UEBhMCVVMwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQIaUWU+EQpcWAIhZ8KPsTjFRSLsg5aWlpmld1vV1t9xCQBicRiUfO+M4t6b3BZZ70xXgzguvbkhhK7O2RyG4aQo4ICVTCCAlEwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBSEtoTMOoZichZZlOgao71I3zrfCzBHBggrBgEFBQcBAQQ7MDkwNwYIKwYBBQUHMAGGK2h0dHA6Ly9vY3NwLmFwcGxlLmNvbS9vY3NwMDQtYXBwbGV3d2RyY2EyMDEwggEdBgNVHSAEggEUMIIBEDCCAQwGCSqGSIb3Y2QFATCB/jCBwwYIKwYBBQUHAgIwgbYMgbNSZWxpYW5jZSBvbiB0aGlzIGNlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRlIHBvbGljeSBhbmQgY2VydGlmaWNhdGlvbiBwcmFjdGljZSBzdGF0ZW1lbnRzLjA2BggrBgEFBQcCARYqaHR0cDovL3d3dy5hcHBsZS5jb20vY2VydGlmaWNhdGVhdXRob3JpdHkvMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwuYXBwbGUuY29tL2FwcGxld3dkcmNhMi5jcmwwHQYDVR0OBBYEFJb/57tMwzwNJRHeu8e/ndwKf+m0MA4GA1UdDwEB/wQEAwIDKDBPBgkqhkiG92NkBiAEQgxAREY4NzBFNjgwQTY4NDZENDIwQkMwQTgzODA2MDQ1RjhGMDdDQjNCRTQ3QjlEQUYzRDY0QzU1QTdBRUI2MzNCMzAKBggqhkjOPQQDAgNHADBEAiBUomLZxgY56Ce1ys7LTNG1B5EgBatPk3OhhFrokT2qngIgGcVgxXyJHLy3lpW5BrZCrQmOQgg/nGTWRPYhmuXdJ60=";
  10.  
  11. byte[] publicKey = Convert.FromBase64String(publicKeyBase64);
  12. SHA256 sha256 = SHA256Managed.Create();
  13. byte[] hash = sha256.ComputeHash(publicKey);
  14. String publicKeyHash = Convert.ToBase64String(hash);
  15.  
  16. Console.WriteLine("Result: {0}", publicKeyHash);
  17. }
  18. }
Success #stdin #stdout 0.03s 27556KB
stdin
Standard input is empty
stdout
Result: aiyzfwi6yj7dBWANHTUQRQxnsm1DupzGwsE7+ND0q74=