Class PemX509Certificate
java.lang.Object
java.security.cert.Certificate
java.security.cert.X509Certificate
io.netty.handler.ssl.PemX509Certificate
- All Implemented Interfaces:
ByteBufHolder, ReferenceCounted, Serializable, X509Extension
This is a special purpose implementation of a
X509Certificate which allows
the user to pass PEM/PKCS#8 encoded data straight into OpenSslContext without
having to parse and re-encode bytes in Java land.
All methods other than what's implemented in PemEncoded's throw
UnsupportedOperationExceptions.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Certificate
Certificate.CertificateRep -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcheckValidity(Date date) content()Return the data which is held by thisByteBufHolder.copy()Creates a deep copy of thisByteBufHolder.Duplicates thisByteBufHolder.booleanintbyte[]byte[]getExtensionValue(String oid) boolean[]boolean[]byte[]byte[]boolean[]byte[]intinthashCode()booleanbooleanintrefCnt()Returns the reference count of this object.booleanrelease()Decreases the reference count by1and deallocates this object if the reference count reaches at0.booleanrelease(int decrement) Decreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.Returns a newByteBufHolderwhich contains the specifiedcontent.retain()Increases the reference count by1.retain(int increment) Increases the reference count by the specifiedincrement.Duplicates thisByteBufHolder.toString()touch()Records the current access location of this object for debugging purposes.Records the current access location of this object with an additional arbitrary information for debugging purposes.static PemX509CertificatevalueOf(byte[] key) Creates aPemX509Certificatefrom rawbyte[].static PemX509CertificateCreates aPemX509Certificatefrom rawByteBuf.voidvoidMethods inherited from class X509Certificate
getExtendedKeyUsage, getIssuerAlternativeNames, getIssuerX500Principal, getSubjectAlternativeNames, getSubjectX500Principal, verifyMethods inherited from class Certificate
getType, writeReplace
-
Method Details
-
valueOf
Creates aPemX509Certificatefrom 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
Creates aPemX509Certificatefrom 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() -
refCnt
public int refCnt()Description copied from interface:ReferenceCountedReturns the reference count of this object. If0, it means this object has been deallocated.- Specified by:
refCntin interfaceReferenceCounted
-
content
Description copied from interface:ByteBufHolderReturn the data which is held by thisByteBufHolder.- Specified by:
contentin interfaceByteBufHolder
-
copy
Description copied from interface:ByteBufHolderCreates a deep copy of thisByteBufHolder.- Specified by:
copyin interfaceByteBufHolder
-
duplicate
Description copied from interface:ByteBufHolderDuplicates thisByteBufHolder. Be aware that this will not automatically callByteBufHolder.retain().- Specified by:
duplicatein interfaceByteBufHolder
-
retainedDuplicate
Description copied from interface:ByteBufHolderDuplicates thisByteBufHolder. This method returns a retained duplicate unlikeByteBufHolder.duplicate().- Specified by:
retainedDuplicatein interfaceByteBufHolder- See Also:
-
replace
Description copied from interface:ByteBufHolderReturns a newByteBufHolderwhich contains the specifiedcontent.- Specified by:
replacein interfaceByteBufHolder
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceReferenceCounted
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceReferenceCounted
-
touch
Description copied from interface:ReferenceCountedRecords 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:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceReferenceCounted
-
touch
Description copied from interface:ReferenceCountedRecords 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:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceReferenceCounted
-
release
public boolean release()Description copied from interface:ReferenceCountedDecreases the reference count by1and deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
release
public boolean release(int decrement) Description copied from interface:ReferenceCountedDecreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
getEncoded
public byte[] getEncoded()- Specified by:
getEncodedin classCertificate
-
hasUnsupportedCriticalExtension
public boolean hasUnsupportedCriticalExtension()- Specified by:
hasUnsupportedCriticalExtensionin interfaceX509Extension
-
getCriticalExtensionOIDs
- Specified by:
getCriticalExtensionOIDsin interfaceX509Extension
-
getNonCriticalExtensionOIDs
- Specified by:
getNonCriticalExtensionOIDsin interfaceX509Extension
-
getExtensionValue
- Specified by:
getExtensionValuein interfaceX509Extension
-
checkValidity
public void checkValidity()- Specified by:
checkValidityin classX509Certificate
-
checkValidity
- Specified by:
checkValidityin classX509Certificate
-
getVersion
public int getVersion()- Specified by:
getVersionin classX509Certificate
-
getSerialNumber
- Specified by:
getSerialNumberin classX509Certificate
-
getIssuerDN
- Specified by:
getIssuerDNin classX509Certificate
-
getSubjectDN
- Specified by:
getSubjectDNin classX509Certificate
-
getNotBefore
- Specified by:
getNotBeforein classX509Certificate
-
getNotAfter
- Specified by:
getNotAfterin classX509Certificate
-
getTBSCertificate
public byte[] getTBSCertificate()- Specified by:
getTBSCertificatein classX509Certificate
-
getSignature
public byte[] getSignature()- Specified by:
getSignaturein classX509Certificate
-
getSigAlgName
- Specified by:
getSigAlgNamein classX509Certificate
-
getSigAlgOID
- Specified by:
getSigAlgOIDin classX509Certificate
-
getSigAlgParams
public byte[] getSigAlgParams()- Specified by:
getSigAlgParamsin classX509Certificate
-
getIssuerUniqueID
public boolean[] getIssuerUniqueID()- Specified by:
getIssuerUniqueIDin classX509Certificate
-
getSubjectUniqueID
public boolean[] getSubjectUniqueID()- Specified by:
getSubjectUniqueIDin classX509Certificate
-
getKeyUsage
public boolean[] getKeyUsage()- Specified by:
getKeyUsagein classX509Certificate
-
getBasicConstraints
public int getBasicConstraints()- Specified by:
getBasicConstraintsin classX509Certificate
-
verify
- Specified by:
verifyin classCertificate
-
verify
- Specified by:
verifyin classCertificate
-
getPublicKey
- Specified by:
getPublicKeyin classCertificate
-
equals
- Overrides:
equalsin classCertificate
-
hashCode
public int hashCode()- Overrides:
hashCodein classCertificate
-
toString
- Specified by:
toStringin classCertificate
-