Package io.netty.handler.ssl
Class DefaultOpenSslKeyMaterial
- java.lang.Object
-
- io.netty.util.AbstractReferenceCounted
-
- io.netty.handler.ssl.DefaultOpenSslKeyMaterial
-
- All Implemented Interfaces:
OpenSslKeyMaterial
,ReferenceCounted
final class DefaultOpenSslKeyMaterial extends AbstractReferenceCounted implements OpenSslKeyMaterial
-
-
Field Summary
Fields Modifier and Type Field Description private long
chain
private ResourceLeakTracker<DefaultOpenSslKeyMaterial>
leak
private static ResourceLeakDetector<DefaultOpenSslKeyMaterial>
leakDetector
private long
privateKey
private java.security.cert.X509Certificate[]
x509CertificateChain
-
Constructor Summary
Constructors Constructor Description DefaultOpenSslKeyMaterial(long chain, long privateKey, java.security.cert.X509Certificate[] x509CertificateChain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.security.cert.X509Certificate[]
certificateChain()
Returns the configuredX509Certificate
s.long
certificateChainAddress()
Returns the pointer to theSTACK_OF(X509)
which holds the certificate chain.protected void
deallocate()
Called onceAbstractReferenceCounted.refCnt()
is equals 0.long
privateKeyAddress()
Returns the pointer to theEVP_PKEY
.boolean
release()
Decreases the reference count by1
and deallocates this object if the reference count reaches at0
.boolean
release(int decrement)
Decreases the reference count by the specifieddecrement
and deallocates this object if the reference count reaches at0
.DefaultOpenSslKeyMaterial
retain()
Increases the reference count by1
.DefaultOpenSslKeyMaterial
retain(int increment)
Increases the reference count by the specifiedincrement
.DefaultOpenSslKeyMaterial
touch()
Records the current access location of this object for debugging purposes.DefaultOpenSslKeyMaterial
touch(java.lang.Object hint)
Records the current access location of this object with an additional arbitrary information for debugging purposes.-
Methods inherited from class io.netty.util.AbstractReferenceCounted
refCnt, setRefCnt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.util.ReferenceCounted
refCnt
-
-
-
-
Field Detail
-
leakDetector
private static final ResourceLeakDetector<DefaultOpenSslKeyMaterial> leakDetector
-
leak
private final ResourceLeakTracker<DefaultOpenSslKeyMaterial> leak
-
x509CertificateChain
private final java.security.cert.X509Certificate[] x509CertificateChain
-
chain
private long chain
-
privateKey
private long privateKey
-
-
Method Detail
-
certificateChain
public java.security.cert.X509Certificate[] certificateChain()
Description copied from interface:OpenSslKeyMaterial
Returns the configuredX509Certificate
s.- Specified by:
certificateChain
in interfaceOpenSslKeyMaterial
-
certificateChainAddress
public long certificateChainAddress()
Description copied from interface:OpenSslKeyMaterial
Returns the pointer to theSTACK_OF(X509)
which holds the certificate chain.- Specified by:
certificateChainAddress
in interfaceOpenSslKeyMaterial
-
privateKeyAddress
public long privateKeyAddress()
Description copied from interface:OpenSslKeyMaterial
Returns the pointer to theEVP_PKEY
.- Specified by:
privateKeyAddress
in interfaceOpenSslKeyMaterial
-
deallocate
protected void deallocate()
Description copied from class:AbstractReferenceCounted
Called onceAbstractReferenceCounted.refCnt()
is equals 0.- Specified by:
deallocate
in classAbstractReferenceCounted
-
retain
public DefaultOpenSslKeyMaterial retain()
Description copied from interface:ReferenceCounted
Increases the reference count by1
.- Specified by:
retain
in interfaceOpenSslKeyMaterial
- Specified by:
retain
in interfaceReferenceCounted
- Overrides:
retain
in classAbstractReferenceCounted
-
retain
public DefaultOpenSslKeyMaterial retain(int increment)
Description copied from interface:ReferenceCounted
Increases the reference count by the specifiedincrement
.- Specified by:
retain
in interfaceOpenSslKeyMaterial
- Specified by:
retain
in interfaceReferenceCounted
- Overrides:
retain
in classAbstractReferenceCounted
-
touch
public DefaultOpenSslKeyMaterial touch()
Description copied from interface:ReferenceCounted
Records the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector
. This method is a shortcut totouch(null)
.- Specified by:
touch
in interfaceOpenSslKeyMaterial
- Specified by:
touch
in interfaceReferenceCounted
- Overrides:
touch
in classAbstractReferenceCounted
-
touch
public DefaultOpenSslKeyMaterial touch(java.lang.Object hint)
Description copied from interface:ReferenceCounted
Records the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector
.- Specified by:
touch
in interfaceOpenSslKeyMaterial
- Specified by:
touch
in interfaceReferenceCounted
-
release
public boolean release()
Description copied from interface:ReferenceCounted
Decreases the reference count by1
and deallocates this object if the reference count reaches at0
.- Specified by:
release
in interfaceOpenSslKeyMaterial
- Specified by:
release
in interfaceReferenceCounted
- Overrides:
release
in classAbstractReferenceCounted
- Returns:
true
if and only if the reference count became0
and this object has been deallocated
-
release
public boolean release(int decrement)
Description copied from interface:ReferenceCounted
Decreases the reference count by the specifieddecrement
and deallocates this object if the reference count reaches at0
.- Specified by:
release
in interfaceOpenSslKeyMaterial
- Specified by:
release
in interfaceReferenceCounted
- Overrides:
release
in classAbstractReferenceCounted
- Returns:
true
if and only if the reference count became0
and this object has been deallocated
-
-