Package io.netty.handler.ssl
Class PemPrivateKey
- java.lang.Object
-
- io.netty.util.AbstractReferenceCounted
-
- io.netty.handler.ssl.PemPrivateKey
-
- All Implemented Interfaces:
io.netty.buffer.ByteBufHolder,io.netty.util.ReferenceCounted,Serializable,Key,PrivateKey,Destroyable
public final class PemPrivateKey extends io.netty.util.AbstractReferenceCounted implements PrivateKey
This is a special purpose implementation of aPrivateKeywhich allows the user to pass PEM/PKCS#8 encoded key material straight intoOpenSslContextwithout having to parse and re-encode bytes in Java land. All methods other than what's implemented inPemEncodedandDestroyablethrowUnsupportedOperationExceptions.- See Also:
PemEncoded,OpenSslContext,valueOf(byte[]),valueOf(ByteBuf), Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.buffer.ByteBufcontent()PemPrivateKeycopy()protected voiddeallocate()voiddestroy()NOTE: This is a JDK8 interface/method.PemPrivateKeyduplicate()StringgetAlgorithm()byte[]getEncoded()StringgetFormat()booleanisDestroyed()NOTE: This is a JDK8 interface/method.booleanisSensitive()PemPrivateKeyreplace(io.netty.buffer.ByteBuf content)PemPrivateKeyretain()PemPrivateKeyretain(int increment)PemPrivateKeyretainedDuplicate()PemPrivateKeytouch()PemPrivateKeytouch(Object hint)static PemPrivateKeyvalueOf(byte[] key)Creates aPemPrivateKeyfrom rawbyte[].static PemPrivateKeyvalueOf(io.netty.buffer.ByteBuf key)Creates aPemPrivateKeyfrom rawByteBuf.-
Methods inherited from class io.netty.util.AbstractReferenceCounted
refCnt, release, release, setRefCnt
-
-
-
-
Method Detail
-
valueOf
public static PemPrivateKey valueOf(byte[] key)
Creates aPemPrivateKeyfrom rawbyte[]. ATTENTION: It's assumed that the given argument is a PEM/PKCS#8 encoded value. No input validation is performed to validate it.
-
valueOf
public static PemPrivateKey valueOf(io.netty.buffer.ByteBuf key)
Creates aPemPrivateKeyfrom rawByteBuf. ATTENTION: It's assumed that the given argument is a PEM/PKCS#8 encoded value. No input validation is performed to validate it.
-
isSensitive
public boolean isSensitive()
-
content
public io.netty.buffer.ByteBuf content()
- Specified by:
contentin interfaceio.netty.buffer.ByteBufHolder
-
copy
public PemPrivateKey copy()
- Specified by:
copyin interfaceio.netty.buffer.ByteBufHolder
-
duplicate
public PemPrivateKey duplicate()
- Specified by:
duplicatein interfaceio.netty.buffer.ByteBufHolder
-
retainedDuplicate
public PemPrivateKey retainedDuplicate()
- Specified by:
retainedDuplicatein interfaceio.netty.buffer.ByteBufHolder
-
replace
public PemPrivateKey replace(io.netty.buffer.ByteBuf content)
- Specified by:
replacein interfaceio.netty.buffer.ByteBufHolder
-
touch
public PemPrivateKey touch()
- Specified by:
touchin interfaceio.netty.buffer.ByteBufHolder- Specified by:
touchin interfaceio.netty.util.ReferenceCounted- Overrides:
touchin classio.netty.util.AbstractReferenceCounted
-
touch
public PemPrivateKey touch(Object hint)
- Specified by:
touchin interfaceio.netty.buffer.ByteBufHolder- Specified by:
touchin interfaceio.netty.util.ReferenceCounted
-
retain
public PemPrivateKey retain()
- Specified by:
retainin interfaceio.netty.buffer.ByteBufHolder- Specified by:
retainin interfaceio.netty.util.ReferenceCounted- Overrides:
retainin classio.netty.util.AbstractReferenceCounted
-
retain
public PemPrivateKey retain(int increment)
- Specified by:
retainin interfaceio.netty.buffer.ByteBufHolder- Specified by:
retainin interfaceio.netty.util.ReferenceCounted- Overrides:
retainin classio.netty.util.AbstractReferenceCounted
-
deallocate
protected void deallocate()
- Specified by:
deallocatein classio.netty.util.AbstractReferenceCounted
-
getEncoded
public byte[] getEncoded()
- Specified by:
getEncodedin interfaceKey
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithmin interfaceKey
-
destroy
public void destroy()
NOTE: This is a JDK8 interface/method. Due to backwards compatibility reasons it's not possible to slap the@Overrideannotation onto this method.- Specified by:
destroyin interfaceDestroyable- See Also:
Destroyable.destroy()
-
isDestroyed
public boolean isDestroyed()
NOTE: This is a JDK8 interface/method. Due to backwards compatibility reasons it's not possible to slap the@Overrideannotation onto this method.- Specified by:
isDestroyedin interfaceDestroyable- See Also:
Destroyable.isDestroyed()
-
-