protected Signer createSigner(AlgorithmIdentifier sigAlgId) throws OperatorCreationException { boolean plainDsa = AlgorithmUtil.isPlainECDSASigAlg(sigAlgId); if (!plainDsa) { return super.createSigner(sigAlgId); } AlgorithmIdentifier digAlg = digestAlgorithmFinder.find(sigAlgId); Digest dig = digestProvider.get(digAlg); return new DSAPlainDigestSigner(new ECDSASigner(), dig); }
@Override protected Signer createSigner(AlgorithmIdentifier sigAlgId) throws OperatorCreationException { if (PKCSObjectIdentifiers.id_RSASSA_PSS.equals(sigAlgId.getAlgorithm())) { try { return SignerUtil.createPSSRSASigner(sigAlgId); } catch (XiSecurityException ex) { throw new OperatorCreationException(ex.getMessage(), ex); } } else { AlgorithmIdentifier digAlg = digestAlgorithmFinder.find(sigAlgId); return new RSADigestSigner(digestProvider.get(digAlg)); } }
@Override protected Signer createSigner(AlgorithmIdentifier sigAlgId) throws OperatorCreationException { if (PKCSObjectIdentifiers.id_RSASSA_PSS.equals(sigAlgId.getAlgorithm())) { try { return SignerUtil.createPSSRSASigner(sigAlgId); } catch (XiSecurityException ex) { throw new OperatorCreationException(ex.getMessage(), ex); } } else { AlgorithmIdentifier digAlg = digestAlgorithmFinder.find(sigAlgId); Digest dig = digestProvider.get(digAlg); return new RSADigestSigner(dig); } }
@Override protected Signer createSigner(AlgorithmIdentifier sigAlgId) throws OperatorCreationException { boolean plainDsa = AlgorithmUtil.isPlainECDSASigAlg(sigAlgId); if (plainDsa) { AlgorithmIdentifier digAlg = digestAlgorithmFinder.find(sigAlgId); Digest dig = digestProvider.get(digAlg); return new DSAPlainDigestSigner(new ECDSASigner(), dig); } boolean sm2 = AlgorithmUtil.isSM2SigAlg(sigAlgId); if (sm2) { AlgorithmIdentifier digAlg = digestAlgorithmFinder.find(sigAlgId); if (GMObjectIdentifiers.sm3.equals(digAlg.getAlgorithm())) { return new SM2Signer(); } else { throw new OperatorCreationException("cannot create SM2 signer for hash algorithm " + digAlg.getAlgorithm().getId()); } } return super.createSigner(sigAlgId); }