| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
package org.xwiki.crypto.signer.internal.factory; |
| 21 |
|
|
| 22 |
|
import javax.inject.Singleton; |
| 23 |
|
|
| 24 |
|
import org.bouncycastle.asn1.DERNull; |
| 25 |
|
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; |
| 26 |
|
import org.bouncycastle.asn1.x509.AlgorithmIdentifier; |
| 27 |
|
import org.bouncycastle.crypto.digests.SHA256Digest; |
| 28 |
|
import org.bouncycastle.crypto.signers.RSADigestSigner; |
| 29 |
|
import org.xwiki.component.annotation.Component; |
| 30 |
|
import org.xwiki.crypto.params.cipher.asymmetric.AsymmetricCipherParameters; |
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
@version |
| 36 |
|
@since |
| 37 |
|
|
| 38 |
|
@Component(hints = { "SHA256withRSAEncryption", "1.2.840.113549.1.1.11" }) |
| 39 |
|
@Singleton |
| |
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
| 40 |
|
public class BcSHA256withRsaSignerFactory extends AbstractBcSignerFactory |
| 41 |
|
{ |
| 42 |
|
private static final AlgorithmIdentifier ALG_ID = |
| 43 |
|
new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE); |
| 44 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 45 |
4 |
@Override... |
| 46 |
|
protected org.bouncycastle.crypto.Signer getSignerInstance(AsymmetricCipherParameters parameters) |
| 47 |
|
{ |
| 48 |
4 |
return new RSADigestSigner(new SHA256Digest()); |
| 49 |
|
} |
| 50 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 51 |
5 |
@Override... |
| 52 |
|
protected AlgorithmIdentifier getSignerAlgorithmIdentifier(AsymmetricCipherParameters parameters) |
| 53 |
|
{ |
| 54 |
5 |
return ALG_ID; |
| 55 |
|
} |
| 56 |
|
} |