ContentObject extends GenericXMLEncodable implements XMLEncodable, Comparable<ContentObject>, ContentNameProvider { public boolean verify(Key key) throws InvalidKeyException, SignatureException, NoSuchAlgorithmException, ContentEncodingException { return verify(this, key); } ContentObject(String digestAlgorithm, // prefer OID
			ContentName name,
			SignedInfo signedInfo,
			byte [] content,
			Signature signature
	);  ContentObject(String digestAlgorithm, // prefer OID
			ContentName name,
			SignedInfo signedInfo,
			byte [] content, int offset, int length,
			Signature signature);  ContentObject(String digestAlgorithm, // prefer OID
			ContentName name,
			SignedInfo signedInfo,
			InputStream contentStream, int length);  ContentObject(
			ContentName name,
			SignedInfo signedInfo,
			InputStream contentStream, int length);  ContentObject(ContentName name, SignedInfo signedInfo, byte [] content,
			Signature signature);  ContentObject(ContentName name, SignedInfo signedInfo, 
			byte [] content, int offset, int length,
			Signature signature);  ContentObject(ContentName name, 
			SignedInfo signedInfo,
			byte [] content, int offset, int length,
			Key signingKey);  ContentObject(ContentName name, 
			SignedInfo signedInfo,
			byte [] content, Key signingKey);  ContentObject(); static ContentObject buildContentObject(ContentName name, ContentType type, byte[] contents, 
			PublisherPublicKeyDigest publisher, KeyLocator locator,
			KeyManager keyManager, Integer freshnessSeconds, byte[] finalBlockID); static ContentObject buildContentObject(ContentName name, ContentType type, byte[] contents, 
			PublisherPublicKeyDigest publisher, KeyLocator locator,
			KeyManager keyManager, byte[] finalBlockID); static ContentObject buildContentObject(ContentName name, ContentType type, byte[] contents, 
			PublisherPublicKeyDigest publisher,
			KeyManager keyManager, byte[] finalBlockID); static ContentObject buildContentObject(ContentName name, byte[] contents, 
			PublisherPublicKeyDigest publisher,
			KeyManager keyManager, byte[] finalBlockID); static ContentObject buildContentObject(ContentName name, byte [] contents); static ContentObject buildContentObject(ContentName name, ContentType type, byte [] contents); static ContentObject buildContentObject(ContentName name, byte [] contents, PublisherPublicKeyDigest publisher); ContentObject clone(); final ContentName name(); final ContentName getContentName(); ContentName fullName(); final SignedInfo signedInfo(); final byte [] content(); final int contentLength(); final Signature signature(); void decode(XMLDecoder decoder); void encode(XMLEncoder encoder); @Override long getElementLabel(); @Override boolean validate(); @Override int hashCode(); @Override boolean equals(Object obj); void setSignature(Signature signature); void sign(Key signingKey); void sign(String digestAlgorithm, Key signingKey); static Signature sign(ContentName name, 
			SignedInfo signedInfo,
			byte [] content, int offset, int length,
			Key signingKey); static Signature sign(ContentName name, 
			SignedInfo signedInfo,
			byte [] content, int offset, int length,
			String digestAlgorithm, 
			Key signingKey); boolean verify(Key key); boolean verify(KeyManager keyManager); static boolean verify(ContentObject object,
								 Key key); static boolean verify(ContentObject object,
								 KeyManager keyManager); static boolean verify(
			ContentName name,
			SignedInfo signedInfo,
			byte [] content,
			Signature signature,
			Key key); static boolean verify(byte[] proxy, byte [] signature, SignedInfo signedInfo,
			String digestAlgorithm, Key key); static boolean verify(byte[] proxy, byte [] signature, SignedInfo signedInfo,
			String digestAlgorithm, KeyManager keyManager); byte [] computeProxy(); byte [] prepareContent(); static byte [] prepareContent(ContentName name, 
			SignedInfo signedInfo, 
			byte [] content); static byte [] prepareContent(final ContentName name, final SignedInfo signedInfo, final byte [] content, int start, int length); byte [] digest(); int compareTo(ContentObject o); boolean isType(ContentType type); boolean isData(); boolean isLink(); boolean isGone(); boolean isNACK(); boolean isKey(); String toString(); static boolean DEBUG_SIGNING; }
@Test public void testDecodeInputStream() { Log.info(Log.FAC_TEST, "Starting testDecodeInputStream"); try { ContentObject cokey = new ContentObject(name, authKey, document3, pair.getPrivate()); ContentObject tdcokey = new ContentObject(); ContentObject bdcokey = new ContentObject(); XMLEncodableTester.encodeDecodeTest("ContentObjectKey", cokey, tdcokey, bdcokey); Assert.assertTrue(cokey.verify(pair.getPublic())); ContentObject co = new ContentObject(name, auth, document3, pair.getPrivate()); ContentObject tdco = new ContentObject(); ContentObject bdco = new ContentObject(); XMLEncodableTester.encodeDecodeTest("ContentObject", co, tdco, bdco); Assert.assertTrue(co.verify(pair.getPublic())); ContentObject coempty = new ContentObject(name, auth, new byte[0], pair.getPrivate()); ContentObject tdcoempty = new ContentObject(); ContentObject bdcoempty = new ContentObject(); XMLEncodableTester.encodeDecodeTest("ContentObject - empty content", coempty, tdcoempty, bdcoempty); Assert.assertTrue(coempty.verify(pair.getPublic())); ContentObject coempty2 = new ContentObject(name, auth, null, pair.getPrivate()); ContentObject tdcoempty2 = new ContentObject(); ContentObject bdcoempty2 = new ContentObject(); XMLEncodableTester.encodeDecodeTest("ContentObject - empty content2", coempty2, tdcoempty2, bdcoempty2); Assert.assertTrue(coempty2.verify(pair.getPublic())); } catch (Exception e) { Log.warning(Log.FAC_TEST, "Exception : " + e.getClass().getName() + ": " + e.getMessage()); Log.warningStackTrace(Log.FAC_TEST, e); Assert.fail("Exception: " + e.getClass().getName() + ": " + e.getMessage()); } Log.info(Log.FAC_TEST, "Completed testDecodeInputStream"); }