102 return genTime;
103 }
104
105 public AlgorithmId getHashAlgorithm() {
106 return hashAlgorithm;
107 }
108
109 // should only be used internally, otherwise return a clone
110 public byte[] getHashedMessage() {
111 return hashedMessage;
112 }
113
114 public BigInteger getNonce() {
115 return nonce;
116 }
117
118 public BigInteger getSerialNumber() {
119 return serialNumber;
120 }
121
122 /*
123 * Parses the timestamp token info.
124 *
125 * @param timestampTokenInfo A buffer containing an ASN.1 BER encoded
126 * TSTInfo.
127 * @throws IOException The exception is thrown if a problem is encountered
128 * while parsing.
129 */
130 private void parse(byte[] timestampTokenInfo) throws IOException {
131
132 DerValue tstInfo = new DerValue(timestampTokenInfo);
133 if (tstInfo.tag != DerValue.tag_Sequence) {
134 throw new IOException("Bad encoding for timestamp token info");
135 }
136 // Parse version
137 version = tstInfo.data.getInteger();
138
139 // Parse policy
140 policy = tstInfo.data.getOID();
141
|
102 return genTime;
103 }
104
105 public AlgorithmId getHashAlgorithm() {
106 return hashAlgorithm;
107 }
108
109 // should only be used internally, otherwise return a clone
110 public byte[] getHashedMessage() {
111 return hashedMessage;
112 }
113
114 public BigInteger getNonce() {
115 return nonce;
116 }
117
118 public BigInteger getSerialNumber() {
119 return serialNumber;
120 }
121
122 public String getPolicyID() {
123 return policy.toString();
124 }
125
126 /*
127 * Parses the timestamp token info.
128 *
129 * @param timestampTokenInfo A buffer containing an ASN.1 BER encoded
130 * TSTInfo.
131 * @throws IOException The exception is thrown if a problem is encountered
132 * while parsing.
133 */
134 private void parse(byte[] timestampTokenInfo) throws IOException {
135
136 DerValue tstInfo = new DerValue(timestampTokenInfo);
137 if (tstInfo.tag != DerValue.tag_Sequence) {
138 throw new IOException("Bad encoding for timestamp token info");
139 }
140 // Parse version
141 version = tstInfo.data.getInteger();
142
143 // Parse policy
144 policy = tstInfo.data.getOID();
145
|