- java.lang.Object
-
- io.netty5.buffer.api.BufferHolder<PemPrivateKey>
-
- io.netty5.handler.ssl.PemPrivateKey
-
- All Implemented Interfaces:
io.netty5.buffer.api.Resource<PemPrivateKey>,Serializable,AutoCloseable,Key,PrivateKey,Destroyable
public final class PemPrivateKey extends io.netty5.buffer.api.BufferHolder<PemPrivateKey> 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 in
PemEncodedandDestroyablethrowUnsupportedOperationExceptions.- See Also:
PemEncoded,OpenSslContext,valueOf(byte[]),valueOf(Buffer), Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()Close this PEM encoded value and free its related resources.io.netty5.buffer.api.Buffercontent()PemPrivateKeycopy()voiddestroy()StringgetAlgorithm()byte[]getEncoded()StringgetFormat()booleanisDestroyed()protected PemPrivateKeyreceive(io.netty5.buffer.api.Buffer buf)static PemPrivateKeyvalueOf(byte[] key)Creates aPemPrivateKeyfrom rawbyte[].static PemPrivateKeyvalueOf(io.netty5.buffer.api.Buffer key)Creates aPemPrivateKeyfrom rawBuffer.
-
-
-
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.netty5.buffer.api.Buffer key)
Creates aPemPrivateKeyfrom rawBuffer. ATTENTION: It's assumed that the given argument is a PEM/PKCS#8 encoded value. No input validation is performed to validate it.
-
content
public io.netty5.buffer.api.Buffer content()
-
copy
public PemPrivateKey copy()
-
receive
protected PemPrivateKey receive(io.netty5.buffer.api.Buffer buf)
- Specified by:
receivein classio.netty5.buffer.api.BufferHolder<PemPrivateKey>
-
getEncoded
public byte[] getEncoded()
- Specified by:
getEncodedin interfaceKey
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithmin interfaceKey
-
destroy
public void destroy()
- Specified by:
destroyin interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()
- Specified by:
isDestroyedin interfaceDestroyable
-
close
public abstract void close()
Close this PEM encoded value and free its related resources.- Specified by:
closein interfaceAutoCloseable
-
-