private TimeStampedDataParser(ASN1SequenceParser parser) throws IOException { this.parser = parser; this.version = ASN1Integer.getInstance(parser.readObject()); ASN1Encodable obj = parser.readObject(); if (obj instanceof DERIA5String) { this.dataUri = DERIA5String.getInstance(obj); obj = parser.readObject(); } if (obj instanceof MetaData || obj instanceof ASN1SequenceParser) { this.metaData = MetaData.getInstance(obj.toASN1Primitive()); obj = parser.readObject(); } if (obj instanceof ASN1OctetStringParser) { this.content = (ASN1OctetStringParser)obj; } }
public OriginatorInfo getOriginatorInfo() throws IOException { originatorInfoCalled = true; if (nextObject == null) { nextObject = seq.readObject(); } if (nextObject instanceof ASN1TaggedObjectParser && ((ASN1TaggedObjectParser)nextObject).getTagNo() == 0) { ASN1SequenceParser originatorInfo = (ASN1SequenceParser) ((ASN1TaggedObjectParser)nextObject).getObjectParser(BERTags.SEQUENCE, false); nextObject = null; return OriginatorInfo.getInstance(originatorInfo.toASN1Primitive()); } return null; }
public EncryptedContentInfoParser getAuthEncryptedContentInfo() throws IOException { if (nextObject == null) { nextObject = seq.readObject(); } if (nextObject != null) { ASN1SequenceParser o = (ASN1SequenceParser) nextObject; nextObject = null; return new EncryptedContentInfoParser(o); } return null; }
public OriginatorInfo getOriginatorInfo() throws IOException { _originatorInfoCalled = true; if (_nextObject == null) { _nextObject = _seq.readObject(); } if (_nextObject instanceof ASN1TaggedObjectParser && ((ASN1TaggedObjectParser)_nextObject).getTagNo() == 0) { ASN1SequenceParser originatorInfo = (ASN1SequenceParser) ((ASN1TaggedObjectParser)_nextObject).getObjectParser(BERTags.SEQUENCE, false); _nextObject = null; return OriginatorInfo.getInstance(originatorInfo.toASN1Primitive()); } return null; }
public EncryptedContentInfoParser getEncryptedContentInfo() throws IOException { if (_nextObject == null) { _nextObject = _seq.readObject(); } if (_nextObject != null) { ASN1SequenceParser o = (ASN1SequenceParser) _nextObject; _nextObject = null; return new EncryptedContentInfoParser(o); } return null; }
public AlgorithmIdentifier getMacAlgorithm() throws IOException { if (nextObject == null) { nextObject = seq.readObject(); } if (nextObject != null) { ASN1SequenceParser o = (ASN1SequenceParser)nextObject; nextObject = null; return AlgorithmIdentifier.getInstance(o.toASN1Primitive()); } return null; }
public ContentInfoParser getEnapsulatedContentInfo() throws IOException { if (nextObject == null) { nextObject = seq.readObject(); } if (nextObject != null) { ASN1SequenceParser o = (ASN1SequenceParser)nextObject; nextObject = null; return new ContentInfoParser(o); } return null; }
/** * @deprecated use getContent(InputExpandedProvider) */ public CMSTypedStream getContent() throws CMSException { try { CompressedDataParser comData = new CompressedDataParser((ASN1SequenceParser)_contentInfo.getContent(BERTags.SEQUENCE)); ContentInfoParser content = comData.getEncapContentInfo(); ASN1OctetStringParser bytes = (ASN1OctetStringParser)content.getContent(BERTags.OCTET_STRING); return new CMSTypedStream(content.getContentType().toString(), new InflaterInputStream(bytes.getOctetStream())); } catch (IOException e) { throw new CMSException("IOException reading compressed content.", e); } }
/** * Return a typed stream which will allow the reading of the compressed content in * expanded form. * * @param expanderProvider a provider of expander algorithm implementations. * @return a type stream which will yield the un-compressed content. * @throws CMSException if there is an exception parsing the CompressedData object. */ public CMSTypedStream getContent(InputExpanderProvider expanderProvider) throws CMSException { try { CompressedDataParser comData = new CompressedDataParser((ASN1SequenceParser)_contentInfo.getContent(BERTags.SEQUENCE)); ContentInfoParser content = comData.getEncapContentInfo(); InputExpander expander = expanderProvider.get(comData.getCompressionAlgorithmIdentifier()); ASN1OctetStringParser bytes = (ASN1OctetStringParser)content.getContent(BERTags.OCTET_STRING); return new CMSTypedStream(content.getContentType().getId(), expander.getInputStream(bytes.getOctetStream())); } catch (IOException e) { throw new CMSException("IOException reading compressed content.", e); } }
public EncryptedContentInfoParser getAuthEncryptedContentInfo() throws IOException { if (nextObject == null) { nextObject = seq.readObject(); } if (nextObject != null) { ASN1SequenceParser o = (ASN1SequenceParser) nextObject; nextObject = null; authEncryptedContentInfoParser = new EncryptedContentInfoParser(o); return authEncryptedContentInfoParser; } return null; }
public ContentInfoParser getEncapsulatedContentInfo() throws IOException { if (nextObject == null) { nextObject = seq.readObject(); } if (nextObject != null) { ASN1SequenceParser o = (ASN1SequenceParser)nextObject; nextObject = null; return new ContentInfoParser(o); } return null; }