private Date getRevocationDateForSigningCertificate(SignatureWrapper currentSignature) { CertificateWrapper signingCertificate = diagnosticData.getUsedCertificateById(currentSignature.getSigningCertificateId()); if (signingCertificate != null && signingCertificate.getRevocationData() != null) { return signingCertificate.getLatestRevocationData().getRevocationDate(); } return null; }
private Date getExpirationDateForSigningCertificate(SignatureWrapper currentSignature) { CertificateWrapper signingCertificate = diagnosticData.getUsedCertificateById(currentSignature.getSigningCertificateId()); if (signingCertificate != null) { return signingCertificate.getNotAfter(); } return null; }
/** * This method returns signing certificate dss id for the first signature. * * @return signing certificate dss id. */ public String getFirstSigningCertificateId() { SignatureWrapper signature = getFirstSignatureNullSafe(); return signature.getSigningCertificateId(); }
/** * This method returns the serial number of the given dss certificate identifier. * * @param dssCertificateId * DSS certificate identifier to be checked * @return serial number */ public String getCertificateSerialNumber(final String dssCertificateId) { CertificateWrapper certificate = getUsedCertificateByIdNullSafe(dssCertificateId); return certificate.getSerialNumber(); }
/** * This method returns the first signature id. * * @return the first signature id */ public String getFirstSignatureId() { SignatureWrapper firstSignature = getFirstSignatureNullSafe(); return firstSignature.getId(); }
/** * The identifier of the policy. * * @param signatureId * The identifier of the signature. * @return the policy identifier */ public String getPolicyId(final String signatureId) { SignatureWrapper signature = getSignatureByIdNullSafe(signatureId); return signature.getPolicyId(); }
/** * This method returns signing certificate dss id for the given signature. * * @param signatureId * The identifier of the signature, for which the signing certificate is sought. * @return signing certificate dss id for the given signature. */ public String getSigningCertificateId(final String signatureId) { SignatureWrapper signature = getSignatureByIdNullSafe(signatureId); return signature.getSigningCertificateId(); }
/** * The identifier of the policy of the first signature. * * @return the policy identifier of the first signature */ public String getFirstPolicyId() { SignatureWrapper signature = getFirstSignatureNullSafe(); return signature.getPolicyId(); }
/** * This method indicates if the certificate signature is valid and the revocation status is valid. * * @param dssCertificateId * DSS certificate identifier to be checked * @return certificate validity */ public boolean isValidCertificate(final String dssCertificateId) { CertificateWrapper certificate = getUsedCertificateByIdNullSafe(dssCertificateId); return certificate.isValidCertificate(); }
/** * This method returns the issuer distinguished name for the given dss certificate identifier. * * @param dssCertificateId * DSS certificate identifier to be checked * @return issuer distinguished name */ public String getCertificateIssuerDN(final String dssCertificateId) { CertificateWrapper certificate = getUsedCertificateByIdNullSafe(dssCertificateId); return certificate.getCertificateIssuerDN(); }
/** * This method returns the signature format for the given signature. * * @param signatureId * The identifier of the signature, for which the format is sought. * @return The signature format */ public String getSignatureFormat(final String signatureId) { SignatureWrapper signature = getSignatureByIdNullSafe(signatureId); return signature.getSignatureFormat(); }
/** * This method returns the list of certificates in the chain of the main signature. * * @param signatureId * The identifier of the signature. * @return list of certificate's dss id for the given signature. */ public List<String> getSignatureCertificateChain(final String signatureId) { SignatureWrapper signature = getSignatureByIdNullSafe(signatureId); return signature.getCertificateChainIds(); }
/** * This method returns the timestamp type of the given timestamp * * @param timestampId * the timestamp id * @return the related timestamp type */ public String getTimestampType(String timestampId) { TimestampWrapper timestamp = getTimestampByIdNullSafe(timestampId); return timestamp.getType(); }
/** * This method returns the {@code DigestAlgorithm} for the given signature. * * @param signatureId * The identifier of the signature, for which the algorithm is sought. * @return The {@code DigestAlgorithm} for the given signature */ public DigestAlgorithm getSignatureDigestAlgorithm(final String signatureId) { SignatureWrapper signature = getSignatureByIdNullSafe(signatureId); return signature.getDigestAlgorithm(); }
/** * This method returns the {@code DigestAlgorithm} for the given signature. * * @param signatureId * The identifier of the signature, for which the algorithm is sought. * @return The {@code DigestAlgorithm} for the given signature */ public EncryptionAlgorithm getSignatureEncryptionAlgorithm(final String signatureId) { SignatureWrapper signature = getSignatureByIdNullSafe(signatureId); return signature.getEncryptionAlgorithm(); }
/** * Indicates if the -A (-LTA) level is technically valid. It means that the signature of the archive timestamps are * valid and their imprint is valid too. * * @param signatureId * The identifier of the signature. * @return true if the signature and digest are valid */ public boolean isALevelTechnicallyValid(final String signatureId) { SignatureWrapper signatureWrapper = getSignatureByIdNullSafe(signatureId); return signatureWrapper.isALevelTechnicallyValid(); }
/** * This method retrieves the error message for the given signature id * * @param signatureId * the signature id * @return the error message */ public String getErrorMessage(final String signatureId) { SignatureWrapper signature = getSignatureByIdNullSafe(signatureId); return signature.getErrorMessage(); }
/** * This method returns the {@code EncryptionAlgorithm} of the first signature. * * @return The {@code EncryptionAlgorithm} of the first signature */ public EncryptionAlgorithm getFirstSignatureEncryptionAlgorithm() { SignatureWrapper signature = getFirstSignatureNullSafe(); return signature.getEncryptionAlgorithm(); }
/** * Indicates if the -B level is technically valid. It means that the signature value is valid. * * @param signatureId * The identifier of the signature. * @return true if the signature value is valid */ public boolean isBLevelTechnicallyValid(final String signatureId) { SignatureWrapper signature = getSignatureByIdNullSafe(signatureId); return signature.isBLevelTechnicallyValid(); }
/** * Indicates if the -T level is technically valid. It means that the signature and the digest are valid. * * @param signatureId * The identifier of the signature. * @return true if the signature and digest are valid */ public boolean isTLevelTechnicallyValid(final String signatureId) { SignatureWrapper signatureWrapper = getSignatureByIdNullSafe(signatureId); return signatureWrapper.isTLevelTechnicallyValid(); }