MCPcopy Create free account
hub / github.com/TrsstProject/trsst / toPublicKeyFromX509

Method toPublicKeyFromX509

src/main/java/com/trsst/Common.java:413–420  ·  view source on GitHub ↗

Converts a X509-encoded EC key to a PublicKey.

(String stored)

Source from the content-addressed store, hash-verified

411 * Converts a X509-encoded EC key to a PublicKey.
412 */
413 public static PublicKey toPublicKeyFromX509(String stored)
414 throws GeneralSecurityException {
415 KeyFactory factory = KeyFactory.getInstance("EC");
416 byte[] data = Base64.decodeBase64(stored);
417 X509EncodedKeySpec spec = new X509EncodedKeySpec(data);
418 return factory.generatePublic(spec);
419
420 }
421
422 /**
423 * Converts an EC PublicKey to an X509-encoded string.

Callers 4

testAppMethod · 0.95
pullMethod · 0.95
postMethod · 0.95
ingestFeedMethod · 0.95

Calls 1

getInstanceMethod · 0.80

Tested by 1

testAppMethod · 0.76