本文整理汇总了Java中ee.sk.digidoc.DigiDocException.getNestedException方法的典型用法代码示例。如果您正苦于以下问题:Java DigiDocException.getNestedException方法的具体用法?Java DigiDocException.getNestedException怎么用?Java DigiDocException.getNestedException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ee.sk.digidoc.DigiDocException
的用法示例。
在下文中一共展示了DigiDocException.getNestedException方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeDataFile
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
private void removeDataFile(File file) {
logger.info("Removing data file: " + file.getName());
int index = -1;
ArrayList ddocDataFiles = ddoc.getDataFiles();
for (int i = 0; i < ddocDataFiles.size(); i++) {
ee.sk.digidoc.DataFile dataFile = (ee.sk.digidoc.DataFile) ddocDataFiles.get(i);
if (dataFile.getFileName().equalsIgnoreCase(file.getName())) index = i;
}
if (index == -1) {
DigiDoc4JException exception = new DigiDoc4JException("File not found");
logger.error(exception.toString());
throw exception;
}
try {
ddoc.removeDataFile(index);
} catch (DigiDocException e) {
logger.error(e.getMessage());
throw new DigiDoc4JException(e.getNestedException());
}
}
示例2: signRaw
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
public Signature signRaw(byte[] rawSignature) {
logger.info("Finalizing DDoc signature");
try {
ddocSignature.setSignatureValue(rawSignature);
DDocSignature signature = new DDocSignature(ddocSignature);
if (signatureProfile == SignatureProfile.LT_TM) {
ddocSignature.getConfirmation();
}
signature.setIndexInArray(getSignatureIndexInArray());
logger.info("Signing DDoc successfully completed");
return signature;
} catch (DigiDocException e) {
logger.error(e.getMessage());
throw new DigiDoc4JException(e.getNestedException());
}
}
示例3: createDDOCContainer
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
private void createDDOCContainer() {
logger.debug("");
try {
ddoc = new SignedDoc("DIGIDOC-XML", "1.3");
signatureParameters.setDigestAlgorithm(DigestAlgorithm.SHA1);
logger.info("DDoc container created");
} catch (DigiDocException e) {
logger.error(e.getMessage());
throw new DigiDoc4JException(e.getNestedException());
}
}
示例4: addDataFile
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
public DataFile addDataFile(String path, String mimeType) {
logger.info("Adding data file: " + path + ", mime type " + mimeType);
try {
ddoc.addDataFile(new File(path), mimeType, CONTENT_EMBEDDED_BASE64);
return new DataFile(path, mimeType);
} catch (DigiDocException e) {
logger.error(e.getMessage());
throw new DigiDoc4JException(e.getNestedException());
}
}
示例5: addRawSignature
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
public void addRawSignature(InputStream signatureStream) {
logger.info("Adding raw XAdES signature");
try {
ddoc.readSignature(signatureStream);
} catch (DigiDocException e) {
logger.error(e.getMessage());
throw new DigiDoc4JException(e.getNestedException());
}
}
示例6: removeSignature
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
/**
* @deprecated will be removed in the future.
*/
public void removeSignature(int index) {
logger.info("Removing signature index: " + index);
try {
ddoc.removeSignature(index);
} catch (DigiDocException e) {
logger.error(e.getMessage());
throw new DigiDoc4JException(e.getNestedException());
}
}
示例7: save
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
public void save(String path) {
logger.info("Saving container to path: " + path);
try {
ddoc.writeToFile(new File(path));
} catch (DigiDocException e) {
logger.error(e.getMessage());
throw new DigiDoc4JException(e.getNestedException());
}
}
示例8: sign
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
public Signature sign(SignatureToken signer) {
logger.info("Signing DDoc container");
calculateSignature(signer);
try {
signRaw(signer.sign(getDigestAlgorithm(), ddocSignature.calculateSignedInfoXML()));
} catch (DigiDocException e) {
logger.error(e.getMessage());
throw new DigiDoc4JException(e.getNestedException());
}
return new DDocSignature(ddocSignature);
}
示例9: addConfirmation
import ee.sk.digidoc.DigiDocException; //导入方法依赖的package包/类
private void addConfirmation() {
logger.debug("");
for (Object signature : ddoc.getSignatures()) {
try {
((ee.sk.digidoc.Signature) signature).getConfirmation();
} catch (DigiDocException e) {
logger.error(e.getMessage());
throw new DigiDoc4JException(e.getNestedException());
}
}
}