public ASN1ObjectIdentifier getContentType() { return contentInfo.getContentType(); }
public ASN1ObjectIdentifier getContentType() { return contentInfo.getContentType(); }
public ASN1ObjectIdentifier getContentType() { return contentInfo.getContentType(); }
public ASN1ObjectIdentifier getContentType() { return contentInfo.getContentType(); }
public ASN1ObjectIdentifier getContentType() { return contentInfo.getContentType(); }
public ASN1ObjectIdentifier getContentType() { return contentInfo.getContentType(); }
/** * Recupera el tipo de contenido. * @return Tipo de contenido. */ public String getContentType() { return this.contentInfo.getContentType().toString(); }
public ASN1ObjectIdentifier getContentType() { return signedData.getEncapContentInfo().getContentType(); }
public ASN1ObjectIdentifier getContentType() { return signedData.getEncapContentInfo().getContentType(); }
public SignedData( ASN1Set digestAlgorithms, ContentInfo contentInfo, ASN1Set certificates, ASN1Set crls, ASN1Set signerInfos) { this.version = calculateVersion(contentInfo.getContentType(), certificates, crls, signerInfos); this.digestAlgorithms = digestAlgorithms; this.contentInfo = contentInfo; this.certificates = certificates; this.crls = crls; this.signerInfos = signerInfos; this.crlsBer = crls instanceof BERSet; this.certsBer = certificates instanceof BERSet; }
public SignedData( ASN1Set digestAlgorithms, ContentInfo contentInfo, ASN1Set certificates, ASN1Set crls, ASN1Set signerInfos) { this.version = calculateVersion(contentInfo.getContentType(), certificates, crls, signerInfos); this.digestAlgorithms = digestAlgorithms; this.contentInfo = contentInfo; this.certificates = certificates; this.crls = crls; this.signerInfos = signerInfos; this.crlsBer = crls instanceof BERSet; this.certsBer = certificates instanceof BERSet; }
/** * Return the a string representation of the OID associated with the * encapsulated content info structure carried in the signed data. * * @return the OID for the content type. */ public String getSignedContentTypeOID() { return signedData.getEncapContentInfo().getContentType().getId(); }
/** * Return the a string representation of the OID associated with the * encapsulated content info structure carried in the signed data. * * @return the OID for the content type. */ public String getSignedContentTypeOID() { return signedData.getEncapContentInfo().getContentType().getId(); }
private void initialize(ContentInfo contentInfo) { this.contentInfo = contentInfo; if (CMSObjectIdentifiers.timestampedData.equals(contentInfo.getContentType())) { this.timeStampedData = TimeStampedData.getInstance(contentInfo.getContent()); } else { throw new IllegalArgumentException("Malformed content - type must be " + CMSObjectIdentifiers.timestampedData.getId()); } util = new TimeStampDataUtil(this.timeStampedData); }
private void initialize(ContentInfo contentInfo) { this.contentInfo = contentInfo; if (CMSObjectIdentifiers.timestampedData.equals(contentInfo.getContentType())) { this.timeStampedData = TimeStampedData.getInstance(contentInfo.getContent()); } else { throw new IllegalArgumentException("Malformed content - type must be " + CMSObjectIdentifiers.timestampedData.getId()); } util = new TimeStampDataUtil(this.timeStampedData); }
/** * return the collection of signers that are associated with the * signatures for the message. */ public SignerInformationStore getSignerInfos() { if (signerInfoStore == null) { ASN1Set s = signedData.getSignerInfos(); List signerInfos = new ArrayList(); for (int i = 0; i != s.size(); i++) { SignerInfo info = SignerInfo.getInstance(s.getObjectAt(i)); ASN1ObjectIdentifier contentType = signedData.getEncapContentInfo().getContentType(); if (hashes == null) { signerInfos.add(new SignerInformation(info, contentType, signedContent, null)); } else { Object obj = hashes.keySet().iterator().next(); byte[] hash = (obj instanceof String) ? (byte[])hashes.get(info.getDigestAlgorithm().getAlgorithm().getId()) : (byte[])hashes.get(info.getDigestAlgorithm().getAlgorithm()); signerInfos.add(new SignerInformation(info, contentType, null, hash)); } } signerInfoStore = new SignerInformationStore(signerInfos); } return signerInfoStore; }
public CMSSignedData( ContentInfo sigData) throws CMSException { this.contentInfo = sigData; this.signedData = getSignedData(); // // this can happen if the signed message is sent simply to send a // certificate chain. // ASN1Encodable content = signedData.getEncapContentInfo().getContent(); if (content != null) { if (content instanceof ASN1OctetString) { this.signedContent = new CMSProcessableByteArray(signedData.getEncapContentInfo().getContentType(), ((ASN1OctetString)content).getOctets()); } else { this.signedContent = new PKCS7ProcessableObject(signedData.getEncapContentInfo().getContentType(), content); } } else { this.signedContent = null; } }
public CMSSignedData( ContentInfo sigData) throws CMSException { this.contentInfo = sigData; this.signedData = getSignedData(); // // this can happen if the signed message is sent simply to send a // certificate chain. // ASN1Encodable content = signedData.getEncapContentInfo().getContent(); if (content != null) { if (content instanceof ASN1OctetString) { this.signedContent = new CMSProcessableByteArray(signedData.getEncapContentInfo().getContentType(), ((ASN1OctetString)content).getOctets()); } else { this.signedContent = new PKCS7ProcessableObject(signedData.getEncapContentInfo().getContentType(), content); } } else { this.signedContent = null; } }
/** * Return the digested content * * @return the digested content * @throws CMSException if there is an exception un-compressing the data. */ public CMSProcessable getDigestedContent() throws CMSException { ContentInfo content = digestedData.getEncapContentInfo(); try { return new CMSProcessableByteArray(content.getContentType(), ((ASN1OctetString)content.getContent()).getOctets()); } catch (Exception e) { throw new CMSException("exception reading digested stream.", e); } }
/** * Return the digested content * * @return the digested content * @throws CMSException if there is an exception un-compressing the data. */ public CMSProcessable getDigestedContent() throws CMSException { ContentInfo content = digestedData.getEncapContentInfo(); try { return new CMSProcessableByteArray(content.getContentType(), ((ASN1OctetString)content.getContent()).getOctets()); } catch (Exception e) { throw new CMSException("exception reading digested stream.", e); } }