Package org.xwiki.crypto.pkix
Class ChainingCertificateProvider
- java.lang.Object
-
- org.xwiki.crypto.pkix.ChainingCertificateProvider
-
- All Implemented Interfaces:
CertificateProvider
public class ChainingCertificateProvider extends Object implements CertificateProvider
Chain two or more certificate provider, asking each of them until found for the requested certificate.- Since:
- 6.0RC1
- Version:
- $Id: 77a43f57520bac84f947fcc6caf2197d5023cc5b $
-
-
Constructor Summary
Constructors Constructor Description ChainingCertificateProvider(CertificateProvider... providers)
Create a new chaining certificate provider from the given providers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CertifiedPublicKey
getCertificate(byte[] keyIdentifier)
Return if available a certificate matching the given keyIdentifier.Collection<CertifiedPublicKey>
getCertificate(PrincipalIndentifier subject)
Return if available a collection of certificate matching the given subject.CertifiedPublicKey
getCertificate(PrincipalIndentifier issuer, BigInteger serial)
Return if available a certificate matching the given keyIdentifier.CertifiedPublicKey
getCertificate(PrincipalIndentifier issuer, BigInteger serial, byte[] keyIdentifier)
Return if available a certificate matching the given keyIdentifier.
-
-
-
Constructor Detail
-
ChainingCertificateProvider
public ChainingCertificateProvider(CertificateProvider... providers)
Create a new chaining certificate provider from the given providers.- Parameters:
providers
- providers to be chained in order.
-
-
Method Detail
-
getCertificate
public CertifiedPublicKey getCertificate(byte[] keyIdentifier)
Description copied from interface:CertificateProvider
Return if available a certificate matching the given keyIdentifier.- Specified by:
getCertificate
in interfaceCertificateProvider
- Parameters:
keyIdentifier
- the subject key identifier of the certificate.- Returns:
- a matching certificate or null if none were found.
-
getCertificate
public CertifiedPublicKey getCertificate(PrincipalIndentifier issuer, BigInteger serial)
Description copied from interface:CertificateProvider
Return if available a certificate matching the given keyIdentifier.- Specified by:
getCertificate
in interfaceCertificateProvider
- Parameters:
issuer
- the subject of the issuer of the certificate.serial
- the serial number attributed by the issuer to the certificate.- Returns:
- a matching certificate or null if none were found.
-
getCertificate
public CertifiedPublicKey getCertificate(PrincipalIndentifier issuer, BigInteger serial, byte[] keyIdentifier)
Description copied from interface:CertificateProvider
Return if available a certificate matching the given keyIdentifier.- Specified by:
getCertificate
in interfaceCertificateProvider
- Parameters:
issuer
- the subject of the issuer of the certificate.serial
- the serial number attributed by the issuer to the certificate.keyIdentifier
- the subject key identifier of the certificate.- Returns:
- a matching certificate or null if none were found.
-
getCertificate
public Collection<CertifiedPublicKey> getCertificate(PrincipalIndentifier subject)
Description copied from interface:CertificateProvider
Return if available a collection of certificate matching the given subject.- Specified by:
getCertificate
in interfaceCertificateProvider
- Parameters:
subject
- the subject of the certificate.- Returns:
- a collection of matching certificate or null if none were found.
-
-