Skip to content

Instantly share code, notes, and snippets.

View Paper-Folding's full-sized avatar

Paper-Folding

  • China
View GitHub Profile
@Paper-Folding
Paper-Folding / ParseRSAKeys.java
Created September 3, 2024 13:21 — forked from destan/ParseRSAKeys.java
Parse RSA public and private key pair from string in Java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;