public final class PemPrivateKey extends AbstractReferenceCounted implements PrivateKey
PrivateKey
which allows the
user to pass PEM/PKCS#8 encoded key material straight into OpenSslContext
without having to parse and re-encode bytes in Java land.
All methods other than what's implemented in PemEncoded
and Destroyable
throw UnsupportedOperationException
s.PemEncoded
,
OpenSslContext
,
valueOf(byte[])
,
valueOf(ByteBuf)
,
Serialized FormserialVersionUID
Modifier and Type | Method and Description |
---|---|
ByteBuf |
content()
Return the data which is held by this
ByteBufHolder . |
PemPrivateKey |
copy()
Creates a deep copy of this
ByteBufHolder . |
protected void |
deallocate()
Called once
AbstractReferenceCounted.refCnt() is equals 0. |
void |
destroy()
NOTE: This is a JDK8 interface/method.
|
PemPrivateKey |
duplicate()
Duplicates this
ByteBufHolder . |
String |
getAlgorithm() |
byte[] |
getEncoded() |
String |
getFormat() |
boolean |
isDestroyed()
NOTE: This is a JDK8 interface/method.
|
boolean |
isSensitive()
Returns
true if the PEM encoded value is considered
sensitive information such as a private key. |
PemPrivateKey |
replace(ByteBuf content)
Returns a new
ByteBufHolder which contains the specified content . |
PemPrivateKey |
retain()
Increases the reference count by
1 . |
PemPrivateKey |
retain(int increment)
Increases the reference count by the specified
increment . |
PemPrivateKey |
retainedDuplicate()
Duplicates this
ByteBufHolder . |
PemPrivateKey |
touch()
Records the current access location of this object for debugging purposes.
|
PemPrivateKey |
touch(Object hint)
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
|
static PemPrivateKey |
valueOf(byte[] key)
Creates a
PemPrivateKey from raw byte[] . |
static PemPrivateKey |
valueOf(ByteBuf key)
Creates a
PemPrivateKey from raw ByteBuf . |
refCnt, release, release, setRefCnt
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
refCnt, release, release
public static PemPrivateKey valueOf(byte[] key)
PemPrivateKey
from raw byte[]
.
ATTENTION: It's assumed that the given argument is a PEM/PKCS#8 encoded value.
No input validation is performed to validate it.public static PemPrivateKey valueOf(ByteBuf key)
PemPrivateKey
from raw ByteBuf
.
ATTENTION: It's assumed that the given argument is a PEM/PKCS#8 encoded value.
No input validation is performed to validate it.public boolean isSensitive()
true
if the PEM encoded value is considered
sensitive information such as a private key.public ByteBuf content()
ByteBufHolder
ByteBufHolder
.public PemPrivateKey copy()
ByteBufHolder
ByteBufHolder
.public PemPrivateKey duplicate()
ByteBufHolder
ByteBufHolder
. Be aware that this will not automatically call ByteBufHolder.retain()
.public PemPrivateKey retainedDuplicate()
ByteBufHolder
ByteBufHolder
. This method returns a retained duplicate unlike ByteBufHolder.duplicate()
.ByteBuf.retainedDuplicate()
public PemPrivateKey replace(ByteBuf content)
ByteBufHolder
ByteBufHolder
which contains the specified content
.public PemPrivateKey touch()
ReferenceCounted
ResourceLeakDetector
. This method is a shortcut to touch(null)
.touch
in interface ReferenceCounted
touch
in class AbstractReferenceCounted
public PemPrivateKey touch(Object hint)
ReferenceCounted
ResourceLeakDetector
.touch
in interface ReferenceCounted
public PemPrivateKey retain()
ReferenceCounted
1
.retain
in interface ReferenceCounted
retain
in class AbstractReferenceCounted
public PemPrivateKey retain(int increment)
ReferenceCounted
increment
.retain
in interface ReferenceCounted
retain
in class AbstractReferenceCounted
protected void deallocate()
AbstractReferenceCounted
AbstractReferenceCounted.refCnt()
is equals 0.deallocate
in class AbstractReferenceCounted
public byte[] getEncoded()
getEncoded
in interface Key
public String getAlgorithm()
getAlgorithm
in interface Key
public void destroy()
@Override
annotation onto
this method.destroy
in interface Destroyable
Destroyable.destroy()
public boolean isDestroyed()
@Override
annotation onto
this method.isDestroyed
in interface Destroyable
Destroyable.isDestroyed()
Copyright © 2008–2017 The Netty Project. All rights reserved.