コード例 #1
0
  public static Signature finalizeXadesC(SignedDoc sdoc, Signature sig) throws DigiDocException {
    if (m_logger.isDebugEnabled())
      m_logger.debug("Finalize XAdES-C: " + sig.getId() + " profile: " + sig.getProfile());
    CompleteRevocationRefs rrefs = new CompleteRevocationRefs();
    CompleteCertificateRefs crefs = new CompleteCertificateRefs();
    UnsignedProperties usp = sig.getUnsignedProperties();
    if (usp == null) {
      usp = new UnsignedProperties(sig);
      sig.setUnsignedProperties(usp);
    }
    usp.setCompleteCertificateRefs(crefs);
    usp.setCompleteRevocationRefs(rrefs);
    rrefs.setUnsignedProperties(usp);
    crefs.setUnsignedProperties(usp);
    sig.setUnsignedProperties(usp);
    sig.setProfile(SignedDoc.BDOC_PROFILE_CL);
    // TODO: update certs and refs

    return sig;
  }
コード例 #2
0
 /**
  * Adds a new CertID object
  *
  * @param cid new object to be added
  */
 public void addCertID(CertID cid) {
   m_unsignedProps.getSignature().addCertID(cid);
 }
コード例 #3
0
 /**
  * return the count of CertID objects
  *
  * @return count of CertID objects
  */
 public int countCertIDs() {
   return m_unsignedProps.getSignature().countCertIDs();
 }
コード例 #4
0
 /**
  * Retrieves CertID element with the desired type. If not found creates a new one with this type.
  *
  * @param type CertID type
  * @return CertID element
  * @throws DigiDocException for validation errors
  */
 public CertID getOrCreateCertIdOfType(int type) throws DigiDocException {
   return m_unsignedProps.getSignature().getOrCreateCertIdOfType(type);
 }
コード例 #5
0
 /**
  * Retrieves CertID element with the desired type
  *
  * @param type CertID type
  * @return CertID element or null if not found
  */
 public CertID getCertIdOfType(int type) {
   return m_unsignedProps.getSignature().getCertIdOfType(type);
 }
コード例 #6
0
 /**
  * Retrieves the last CertID element
  *
  * @return CertID element or null if not found
  */
 public CertID getLastCertId() {
   return m_unsignedProps.getSignature().getLastCertId();
 }
コード例 #7
0
 /**
  * Retrieves CertID element with the desired index
  *
  * @param idx CertID index
  * @return CertID element or null if not found
  */
 public CertID getCertID(int idx) {
   return m_unsignedProps.getSignature().getCertID(idx);
 }