Exemplo n.º 1
0
 /**
  * Returns the SignatureFactory instance
  *
  * @return SignatureFactory implementation
  */
 public SignatureFactory getSignatureFactory() throws SignedDocException {
   SignatureFactory sigFac = null;
   try {
     sigFac = (SignatureFactory) Class.forName(getProperty("DIGIDOC_SIGN_IMPL")).newInstance();
     sigFac.init();
   } catch (SignedDocException ex) {
     throw ex;
   } catch (Exception ex) {
     SignedDocException.handleException(ex, SignedDocException.ERR_INIT_SIG_FAC);
   }
   return sigFac;
 }
Exemplo n.º 2
0
 /**
  * Returns the CRLFactory instance
  *
  * @return CRLFactory implementation
  */
 public CRLFactory getCRLFactory() throws SignedDocException {
   try {
     if (m_crlFac == null) {
       m_crlFac = (CRLFactory) Class.forName(getProperty("CRL_FACTORY_IMPL")).newInstance();
       m_crlFac.init();
     }
   } catch (SignedDocException ex) {
     throw ex;
   } catch (Exception ex) {
     SignedDocException.handleException(ex, SignedDocException.ERR_INIT_CRL_FAC);
   }
   return m_crlFac;
 }
Exemplo n.º 3
0
 /**
  * Returns the DigiDocFactory instance
  *
  * @return DigiDocFactory implementation
  */
 public DigiDocFactory getSignedDocFactory() throws SignedDocException {
   DigiDocFactory digFac = null;
   try {
     // ROB
     digFac = (DigiDocFactory) Class.forName(getProperty("SIGNEDDOC_FACTORY_IMPL")).newInstance();
     digFac.init();
   } catch (SignedDocException ex) {
     throw ex;
   } catch (Exception ex) {
     SignedDocException.handleException(ex, SignedDocException.ERR_DIG_FAC_INIT);
   }
   return digFac;
 }
Exemplo n.º 4
0
 /**
  * Returns the NotaryFactory instance
  *
  * @return NotaryFactory implementation
  */
 public NotaryFactory getNotaryFactory() throws SignedDocException {
   try {
     if (m_notFac == null) {
       m_notFac = (NotaryFactory) Class.forName(getProperty("DIGIDOC_NOTARY_IMPL")).newInstance();
       m_notFac.init();
     }
   } catch (SignedDocException ex) {
     throw ex;
   } catch (Exception ex) {
     SignedDocException.handleException(ex, SignedDocException.ERR_NOT_FAC_INIT);
   }
   return m_notFac;
 }
Exemplo n.º 5
0
 /**
  * Returns the EncryptedStreamParser instance
  *
  * @return EncryptedStreamParser implementation
  */
 public EncryptedStreamParser getEncryptedStreamParser() throws SignedDocException {
   try {
     if (m_dstrFac == null)
       m_dstrFac =
           (EncryptedStreamParser)
               Class.forName(getProperty("ENCRYPTED_STREAM_PARSER_IMPL")).newInstance();
     m_dstrFac.init();
   } catch (SignedDocException ex) {
     throw ex;
   } catch (Exception ex) {
     SignedDocException.handleException(ex, SignedDocException.ERR_DIG_FAC_INIT);
   }
   return m_dstrFac;
 }
Exemplo n.º 6
0
 /**
  * Returns the TimestampFactory instance
  *
  * @return TimestampFactory implementation
  */
 public TimestampFactory getTimestampFactory() throws SignedDocException {
   try {
     if (m_tsFac == null) {
       m_tsFac =
           (TimestampFactory) Class.forName(getProperty("DIGIDOC_TIMESTAMP_IMPL")).newInstance();
       m_tsFac.init();
     }
   } catch (SignedDocException ex) {
     throw ex;
   } catch (Exception ex) {
     SignedDocException.handleException(ex, SignedDocException.ERR_TIMESTAMP_FAC_INIT);
   }
   return m_tsFac;
 }
Exemplo n.º 7
0
 /**
  * Returns the CanonicalizationFactory instance
  *
  * @return CanonicalizationFactory implementation
  */
 public CanonicalizationFactory getCanonicalizationFactory() throws SignedDocException {
   try {
     if (m_canFac == null) {
       m_canFac =
           (CanonicalizationFactory)
               Class.forName(getProperty("CANONICALIZATION_FACTORY_IMPL")).newInstance();
       // System.out.println("Config c14n: "+getProperty("CANONICALIZATION_FACTORY_IMPL"));
       m_canFac.init();
     }
   } catch (SignedDocException ex) {
     throw ex;
   } catch (Exception ex) {
     SignedDocException.handleException(ex, SignedDocException.ERR_CAN_FAC_INIT);
   }
   return m_canFac;
 }
Exemplo n.º 8
0
 /**
  * Returns the SignatureFactory instance
  *
  * @param type type of signature factory
  * @return SignatureFactory implementation
  */
 public SignatureFactory getSignatureFactory(String type) throws SignedDocException {
   SignatureFactory sigFac = null;
   try {
     String strClass = getProperty("DIGIDOC_SIGN_IMPL_" + type);
     if (strClass != null) {
       sigFac = (SignatureFactory) Class.forName(strClass).newInstance();
       if (sigFac != null) sigFac.init();
     }
     if (sigFac == null)
       throw new SignedDocException(
           SignedDocException.ERR_INIT_SIG_FAC, "No signature factory of type: " + type, null);
   } catch (SignedDocException ex) {
     throw ex;
   } catch (Exception ex) {
     SignedDocException.handleException(ex, SignedDocException.ERR_INIT_SIG_FAC);
   }
   return sigFac;
 }