C
- the certificate class supported by this security callback.public class TlsTmSecurityCallbackProxy<C extends Certificate> extends Object implements TlsTmSecurityCallback<C>
TlsTmSecurityCallbackProxy
class implements a TlsTmSecurityCallback
by using an
internal reference to another TlsTmSecurityCallback
instance. It can be used to defer the creation
of the backing security callback to a later time.Constructor and Description |
---|
TlsTmSecurityCallbackProxy() |
Modifier and Type | Method and Description |
---|---|
String |
getLocalCertificateAlias(Address targetAddress)
Gets the local certificate alias to be used for the supplied target address.
|
OctetString |
getSecurityName(C[] peerCertificateChain)
Gets the tmSecurityName (see RFC 5953) from the certificate chain of the communication peer that needs to be
authenticated.
|
TlsTmSecurityCallback<C> |
getTlsTmSecurityCallback() |
boolean |
isAcceptedIssuer(C issuerCertificate)
Check if the supplied issuer certificate is accepted as server.
|
boolean |
isClientCertificateAccepted(C peerEndCertificate)
Check if the supplied peer end certificate is accepted as client.
|
boolean |
isServerCertificateAccepted(C[] peerCertificateChain)
Check if the supplied peer certificate chain is accepted as server.
|
void |
setTlsTmSecurityCallback(TlsTmSecurityCallback<C> tlsTmSecurityCallback)
Sets the security callback to be used when this proxy is being called.
|
public TlsTmSecurityCallback<C> getTlsTmSecurityCallback()
public void setTlsTmSecurityCallback(TlsTmSecurityCallback<C> tlsTmSecurityCallback)
tlsTmSecurityCallback
- the actually used security callback. If null
, then the security callback methods will always
return false
and null
respectively.public OctetString getSecurityName(C[] peerCertificateChain)
TlsTmSecurityCallback
getSecurityName
in interface TlsTmSecurityCallback<C extends Certificate>
peerCertificateChain
- an array of Certificate
s with the peer's own certificate first followed by any CA authorities.public boolean isClientCertificateAccepted(C peerEndCertificate) throws CertificateException
TlsTmSecurityCallback
isClientCertificateAccepted
in interface TlsTmSecurityCallback<C extends Certificate>
peerEndCertificate
- a client Certificate instance to check acceptance for.true
if the certificate is accepted, false
otherwise, i.e. if verification could not
performed, i.e. because it was not configured sufficiently.CertificateException
- if the certificate is rejected.public boolean isServerCertificateAccepted(C[] peerCertificateChain) throws CertificateException
TlsTmSecurityCallback
isServerCertificateAccepted
in interface TlsTmSecurityCallback<C extends Certificate>
peerCertificateChain
- a server Certificate chain to check acceptance for.true
if the certificate is accepted, false
otherwise, i.e. if verification could not
performed, i.e. because it was not configured sufficiently.CertificateException
- if the certificate is rejected.public boolean isAcceptedIssuer(C issuerCertificate) throws CertificateException
TlsTmSecurityCallback
isAcceptedIssuer
in interface TlsTmSecurityCallback<C extends Certificate>
issuerCertificate
- an issuer Certificate instance to check acceptance for.true
if the certificate is accepted, false
otherwise, i.e. if verification could not
performed, i.e. because it was not configured sufficiently.CertificateException
- if the certificate is rejected.public String getLocalCertificateAlias(Address targetAddress)
TlsTmSecurityCallback
getLocalCertificateAlias
in interface TlsTmSecurityCallback<C extends Certificate>
targetAddress
- a target address or null
if the default local certificate alias needs to be retrieved.null
is returned which could cause a
protocol violation if the local key store contains more than one certificate.Copyright © 2022 SNMP4J.org. All rights reserved.