나는 iText를하고 TSAClient 클래스를 이용하여 표준 용액을 봤했지만 그것은 온라인 서비스로 TSA가 필요합니다.
/**
* Time Stamp Authority client (caller) interface.
* <p>
* Interface used by the PdfPKCS7 digital signature builder to call
* Time Stamp Authority providing RFC 3161 compliant time stamp token.
* @author Martin Brunecky, 07/17/2007
* @since 2.1.6
*/
public interface TSAClient {
/**
* Get the time stamp token size estimate.
* Implementation must return value large enough to accomodate the entire token
* returned by getTimeStampToken() _prior_ to actual getTimeStampToken() call.
* @return an estimate of the token size
*/
public int getTokenSizeEstimate();
/**
* Get RFC 3161 timeStampToken.
* Method may return null indicating that timestamp should be skipped.
* @param caller PdfPKCS7 - calling PdfPKCS7 instance (in case caller needs it)
* @param imprint byte[] - data imprint to be time-stamped
* @return byte[] - encoded, TSA signed data of the timeStampToken
* @throws Exception - TSA request failed
*/
public byte[] getTimeStampToken(PdfPKCS7 caller, byte[] imprint) throws Exception;
}
따라서, 당신이 할 일은 당신이 원하는 어떤 방식으로 타임 스탬프를 생성하는 인터페이스를 구현하는 것입니다 :
TSAClient
최종 클래스하지만, 단지 인터페이스가 아닙니다. 주석이 일부 온라인 서비스를 암시하는 것처럼 보일지라도 byte[]
타임 스탬프가 주어진 byte[] imprint
을 스탬프하면됩니다.
그런 말처럼, 타임 스탬핑은 실제로 그 이름의 가치가 없습니다. 허용할만한 오류 범위 내에서 올바른 타임 스탬프를 작성할 수 있습니까?
따라서 기존의 TSAClient
구현은 거의 찾을 수 없습니다. 그러나 Bouncy Castle과 같은 기존의 보안 라이브러리는 타임 스탬프 요청 응답을 매우 쉽게 만들어야합니다.
출처
2014-01-24 15:26:26
mkl
PDFStamper를 보셨습니까? – epoch
타임 스탬프 서버를 로컬로 설정합니다. 코드에서 온라인 타임 스탬프 서버로 사용할 수 있습니다. – mkl
안녕하세요, 저는 PFDStamper를 살펴 보았지만 모든 샘플은 TSA를 온라인 서비스로 사용합니다 (TSAClient 클래스를 통해). 우리는 TSA 서버 (온라인 또는 로컬)가 없으며 해당 서버의 인증서 (개인 키 포함) 만 있습니다. – user3232054