@Test public void testSignatureExtension_noCalendarChainInSignature() throws Exception { KSISignature signature = createExtensionFuture(SIGNATURE_2014_06_02_ONLY_AGGREGATION_HASH_CHAINS, CALENDAR_HASH_CHAIN_FOR_SIGNATURE_2017_03_14).getResult(); Assert.assertTrue(signature.isExtended()); }
public KSISignature getResult() throws KSIException { if (extendedSignature == null) { try { ExtensionResponse extensionResponse = future.getResult(); CalendarHashChain calendarHashChain = signatureComponentFactory.createCalendarHashChain(extensionResponse.getCalendarHashChain()); if (signature.getCalendarHashChain() != null && !areRightLinksConsistent(signature.getCalendarHashChain(), calendarHashChain)) { throw new InconsistentCalendarHashChainException("Right links of signature calendar hash chain and extended calendar hash chain do not match"); } SignaturePublicationRecord publication = signatureComponentFactory.createPublicationRecord(publicationRecord.getPublicationData(), publicationRecord.getPublicationReferences(), publicationRecord.getPublicationRepositoryURIs()); extendedSignature = signatureFactory.createSignature(asList(signature.getAggregationHashChains()), calendarHashChain, null, publication, signature.getRfc3161Record()); } catch (com.guardtime.ksi.tlv.TLVParserException e) { throw new KSIProtocolException("Can't parse response message", e); } } return extendedSignature; }
ExtensionFuture implements Future<KSISignature> { public KSISignature getResult() throws KSIException { if (extendedSignature == null) { try { ExtensionResponse extensionResponse = future.getResult(); CalendarHashChain calendarHashChain = signatureComponentFactory.createCalendarHashChain(extensionResponse.getCalendarHashChain()); if (signature.getCalendarHashChain() != null && !areRightLinksConsistent(signature.getCalendarHashChain(), calendarHashChain)) { throw new InconsistentCalendarHashChainException("Right links of signature calendar hash chain and extended calendar hash chain do not match"); } SignaturePublicationRecord publication = signatureComponentFactory.createPublicationRecord(publicationRecord.getPublicationData(), publicationRecord.getPublicationReferences(), publicationRecord.getPublicationRepositoryURIs()); extendedSignature = signatureFactory.createSignature(asList(signature.getAggregationHashChains()), calendarHashChain, null, publication, signature.getRfc3161Record()); } catch (com.guardtime.ksi.tlv.TLVParserException e) { throw new KSIProtocolException("Can't parse response message", e); } } return extendedSignature; } }
ExtensionFuture implements Future<KSISignature> { public KSISignature getResult() throws KSIException { if (extendedSignature == null) { try { ExtensionResponse extensionResponse = future.getResult(); CalendarHashChain calendarHashChain = signatureComponentFactory.createCalendarHashChain(extensionResponse.getCalendarHashChain()); if (signature.getCalendarHashChain() != null && !areRightLinksConsistent(signature.getCalendarHashChain(), calendarHashChain)) { throw new InconsistentCalendarHashChainException("Right links of signature calendar hash chain and extended calendar hash chain do not match"); } SignaturePublicationRecord publication = signatureComponentFactory.createPublicationRecord(publicationRecord.getPublicationData(), publicationRecord.getPublicationReferences(), publicationRecord.getPublicationRepositoryURIs()); extendedSignature = signatureFactory.createSignature(asList(signature.getAggregationHashChains()), calendarHashChain, null, publication, signature.getRfc3161Record()); } catch (com.guardtime.ksi.tlv.TLVParserException e) { throw new KSIProtocolException("Can't parse response message", e); } } return extendedSignature; } ExtensionFuture(Future<ExtensionResponse> future, PublicationRecord publicationRecord, KSISignature signature,
                           KSISignatureComponentFactory signatureComponentFactory, KSISignatureFactory signatureFactory); }
ExtensionFuture implements Future<KSISignature> { public KSISignature getResult() throws KSIException { if (extendedSignature == null) { try { ExtensionResponse extensionResponse = future.getResult(); CalendarHashChain calendarHashChain = signatureComponentFactory.createCalendarHashChain(extensionResponse.getCalendarHashChain()); if (signature.getCalendarHashChain() != null && !areRightLinksConsistent(signature.getCalendarHashChain(), calendarHashChain)) { throw new InconsistentCalendarHashChainException("Right links of signature calendar hash chain and extended calendar hash chain do not match"); } SignaturePublicationRecord publication = signatureComponentFactory.createPublicationRecord(publicationRecord.getPublicationData(), publicationRecord.getPublicationReferences(), publicationRecord.getPublicationRepositoryURIs()); extendedSignature = signatureFactory.createSignature(asList(signature.getAggregationHashChains()), calendarHashChain, null, publication, signature.getRfc3161Record()); } catch (com.guardtime.ksi.tlv.TLVParserException e) { throw new KSIProtocolException("Can't parse response message", e); } } return extendedSignature; } ExtensionFuture(Future<ExtensionResponse> future, PublicationRecord publicationRecord, KSISignature signature,
                           KSISignatureComponentFactory signatureComponentFactory, KSISignatureFactory signatureFactory); KSISignature getResult(); boolean isFinished(); }
ExtensionFuture implements Future<KSISignature> { public KSISignature getResult() throws KSIException { if (extendedSignature == null) { try { ExtensionResponse extensionResponse = future.getResult(); CalendarHashChain calendarHashChain = signatureComponentFactory.createCalendarHashChain(extensionResponse.getCalendarHashChain()); if (signature.getCalendarHashChain() != null && !areRightLinksConsistent(signature.getCalendarHashChain(), calendarHashChain)) { throw new InconsistentCalendarHashChainException("Right links of signature calendar hash chain and extended calendar hash chain do not match"); } SignaturePublicationRecord publication = signatureComponentFactory.createPublicationRecord(publicationRecord.getPublicationData(), publicationRecord.getPublicationReferences(), publicationRecord.getPublicationRepositoryURIs()); extendedSignature = signatureFactory.createSignature(asList(signature.getAggregationHashChains()), calendarHashChain, null, publication, signature.getRfc3161Record()); } catch (com.guardtime.ksi.tlv.TLVParserException e) { throw new KSIProtocolException("Can't parse response message", e); } } return extendedSignature; } ExtensionFuture(Future<ExtensionResponse> future, PublicationRecord publicationRecord, KSISignature signature,
                           KSISignatureComponentFactory signatureComponentFactory, KSISignatureFactory signatureFactory); KSISignature getResult(); boolean isFinished();  }