일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 2FA
- 앱리소스
- WebAuthn
- 앨범북
- css
- otpkey
- OTP
- SSL
- 애플
- git
- openssl
- SSH
- SWIFT
- OSX
- Xcode
- 인증
- fido
- 안드로이드
- MSYS2
- FIDO2
- SwiftUI
- kmip
- 앱스토어
- MFA
- Android
- MYSQL
- albumbook
- Nodejs
- appres
- apple
Archives
- Today
- Total
인디노트
Save/Load Private and Public Key to/from a file 본문
- package net.java.edem;
- import java.io.*;
- import java.security.*;
- import java.security.spec.*;
- public class Adam {
- Adam adam = new Adam();
- try {
- String path = "C:\\Documents and Settings\\george\\My Documents\\workspaces\\gsoc09\\playground\\tmp";
- keyGen.initialize(1024);
- adam.dumpKeyPair(generatedKeyPair);
- adam.SaveKeyPair(path, generatedKeyPair);
- adam.dumpKeyPair(loadedKeyPair);
- e.printStackTrace();
- return;
- }
- }
- }
- for (int i = 0; i < b.length; i++) {
- }
- return result;
- }
- // Store Public Key.
- publicKey.getEncoded());
- fos.write(x509EncodedKeySpec.getEncoded());
- fos.close();
- // Store Private Key.
- privateKey.getEncoded());
- fos.write(pkcs8EncodedKeySpec.getEncoded());
- fos.close();
- }
- // Read Public Key.
- byte[] encodedPublicKey = new byte[(int) filePublicKey.length()];
- fis.read(encodedPublicKey);
- fis.close();
- // Read Private Key.
- byte[] encodedPrivateKey = new byte[(int) filePrivateKey.length()];
- fis.read(encodedPrivateKey);
- fis.close();
- // Generate KeyPair.
- encodedPublicKey);
- encodedPrivateKey);
- }
- }
반응형
'인증기술' 카테고리의 다른 글
이게 맞는 말인지 확인이 필요하다. (0) | 2018.08.03 |
---|---|
Creating X.509 certificates programmatically in Java (0) | 2018.07.27 |
Java Certificate 함수 (0) | 2018.07.25 |
RSA java 예제(2) - 3개 파트 분리 소스 (0) | 2018.07.17 |
공인인증기관별 OID 목록 (0) | 2018.07.12 |
Comments