1
나는 Bouncycastle을 처음 사용하고 있습니다. http 연결로 TSA 서버에서 timeStampToken
을 얻을 수 있습니다.Bouncycastle Java - TimestampToken에서 tst 파일 생성
InputStream in = con.getInputStream();
TimeStampResp resp = TimeStampResp.getInstance(new ASN1InputStream(in).readObject());
TimeStampResponse response = new TimeStampResponse(resp);
response.validate(timeStampRequest);
InputStream in = con.getInputStream();
TimeStampResp resp = TimeStampResp.getInstance(new ASN1InputStream(in).readObject());
TimeStampResponse response = new TimeStampResponse(resp);
response.validate(timeStampRequest);
다음으로 TimeStampResponse
개체에서 파일을 생성해야합니다. 다른 클라이언트 응용 프로그램과 함께 생성 된 파일에는 CRL/OCSP URL 정보가 있지만 내 파일에는이 정보가 없습니다. 이 파일을 어떻게 생성 할 수 있습니까?
FileOutputStream fos;
try {
fos = new FileOutputStream(
"C:/FORM-003.pdf.tst");
fos.write(response.getEncoded());
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
도움 주셔서 감사합니다.