forked from rachanon/stdbWeb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2728 lines
73 KiB
2728 lines
73 KiB
9 years ago
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||
|
<head>
|
||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||
|
<meta name="generator" content="JsDoc Toolkit" />
|
||
|
|
||
|
<title>jsrsasign 4.8.7 JavaScript API Reference - X509</title>
|
||
|
|
||
|
<style type="text/css">
|
||
|
/* default.css */
|
||
|
body
|
||
|
{
|
||
|
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
|
||
|
width: 800px;
|
||
|
}
|
||
|
|
||
|
.header
|
||
|
{
|
||
|
clear: both;
|
||
|
background-color: #ccc;
|
||
|
padding: 8px;
|
||
|
}
|
||
|
|
||
|
h1
|
||
|
{
|
||
|
font-size: 150%;
|
||
|
font-weight: bold;
|
||
|
padding: 0;
|
||
|
margin: 1em 0 0 .3em;
|
||
|
}
|
||
|
|
||
|
hr
|
||
|
{
|
||
|
border: none 0;
|
||
|
border-top: 1px solid #7F8FB1;
|
||
|
height: 1px;
|
||
|
}
|
||
|
|
||
|
pre.code
|
||
|
{
|
||
|
display: block;
|
||
|
padding: 8px;
|
||
|
border: 1px dashed #ccc;
|
||
|
}
|
||
|
|
||
|
#index
|
||
|
{
|
||
|
margin-top: 24px;
|
||
|
float: left;
|
||
|
width: 160px;
|
||
|
position: absolute;
|
||
|
left: 8px;
|
||
|
background-color: #F3F3F3;
|
||
|
padding: 8px;
|
||
|
}
|
||
|
|
||
|
#content
|
||
|
{
|
||
|
margin-left: 190px;
|
||
|
width: 600px;
|
||
|
}
|
||
|
|
||
|
.classList
|
||
|
{
|
||
|
list-style-type: none;
|
||
|
padding: 0;
|
||
|
margin: 0 0 0 8px;
|
||
|
font-family: arial, sans-serif;
|
||
|
font-size: 1em;
|
||
|
overflow: auto;
|
||
|
}
|
||
|
|
||
|
.classList li
|
||
|
{
|
||
|
padding: 0;
|
||
|
margin: 0 0 8px 0;
|
||
|
}
|
||
|
|
||
|
.summaryTable { width: 100%; }
|
||
|
|
||
|
h1.classTitle
|
||
|
{
|
||
|
font-size:170%;
|
||
|
line-height:130%;
|
||
|
}
|
||
|
|
||
|
h2 { font-size: 110%; }
|
||
|
caption, div.sectionTitle
|
||
|
{
|
||
|
background-color: #7F8FB1;
|
||
|
color: #fff;
|
||
|
font-size:130%;
|
||
|
text-align: left;
|
||
|
padding: 2px 6px 2px 6px;
|
||
|
border: 1px #7F8FB1 solid;
|
||
|
}
|
||
|
|
||
|
div.sectionTitle { margin-bottom: 8px; }
|
||
|
.summaryTable thead { display: none; }
|
||
|
|
||
|
.summaryTable td
|
||
|
{
|
||
|
vertical-align: top;
|
||
|
padding: 4px;
|
||
|
border-bottom: 1px #7F8FB1 solid;
|
||
|
border-right: 1px #7F8FB1 solid;
|
||
|
}
|
||
|
|
||
|
/*col#summaryAttributes {}*/
|
||
|
.summaryTable td.attributes
|
||
|
{
|
||
|
border-left: 1px #7F8FB1 solid;
|
||
|
width: 140px;
|
||
|
text-align: right;
|
||
|
}
|
||
|
|
||
|
td.attributes, .fixedFont
|
||
|
{
|
||
|
line-height: 15px;
|
||
|
color: #002EBE;
|
||
|
font-family: "Courier New",Courier,monospace;
|
||
|
font-size: 13px;
|
||
|
}
|
||
|
|
||
|
.summaryTable td.nameDescription
|
||
|
{
|
||
|
text-align: left;
|
||
|
font-size: 13px;
|
||
|
line-height: 15px;
|
||
|
}
|
||
|
|
||
|
.summaryTable td.nameDescription, .description
|
||
|
{
|
||
|
line-height: 15px;
|
||
|
padding: 4px;
|
||
|
padding-left: 4px;
|
||
|
}
|
||
|
|
||
|
.summaryTable { margin-bottom: 8px; }
|
||
|
|
||
|
ul.inheritsList
|
||
|
{
|
||
|
list-style: square;
|
||
|
margin-left: 20px;
|
||
|
padding-left: 0;
|
||
|
}
|
||
|
|
||
|
.detailList {
|
||
|
margin-left: 20px;
|
||
|
line-height: 15px;
|
||
|
}
|
||
|
.detailList dt { margin-left: 20px; }
|
||
|
|
||
|
.detailList .heading
|
||
|
{
|
||
|
font-weight: bold;
|
||
|
padding-bottom: 6px;
|
||
|
margin-left: 0;
|
||
|
}
|
||
|
|
||
|
.light, td.attributes, .light a:link, .light a:visited
|
||
|
{
|
||
|
color: #777;
|
||
|
font-style: italic;
|
||
|
}
|
||
|
|
||
|
.fineprint
|
||
|
{
|
||
|
text-align: right;
|
||
|
font-size: 10px;
|
||
|
}
|
||
|
</style>
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<!-- ============================== header ================================= -->
|
||
|
<!-- begin static/header.html -->
|
||
|
<div id="header" style="background: #7F8FB1; color: white; margin: -10px">
|
||
|
<b><a href="http://kjur.github.com/jsrsasign/" style="color: white">jsrsasign</a></b> JavaScript API Reference
|
||
|
</div>
|
||
|
|
||
|
<!-- end static/header.html -->
|
||
|
|
||
|
<!-- ============================== classes index ============================ -->
|
||
|
<div id="index">
|
||
|
<!-- begin publish.classesIndex -->
|
||
|
<div align="center"><a href="../index.html">Class Index</a>
|
||
|
| <a href="../files.html">File Index</a></div>
|
||
|
<hr />
|
||
|
<h2>Classes</h2>
|
||
|
<ul class="classList">
|
||
|
|
||
|
<li><i><a href="../symbols/global__.html">global__</a></i></li>
|
||
|
|
||
|
<li><a href="../symbols/ASN1HEX.html">ASN1HEX</a></li>
|
||
|
|
||
|
<li><a href="../symbols/Base64x.html">Base64x</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KEYUTIL.html">KEYUTIL</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.html">KJUR</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.html">KJUR.asn1</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.ASN1Object.html">KJUR.asn1.ASN1Object</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.ASN1Util.html">KJUR.asn1.ASN1Util</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cades.html">KJUR.asn1.cades</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cades.CAdESUtil.html">KJUR.asn1.cades.CAdESUtil</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cades.CompleteCertificateRefs.html">KJUR.asn1.cades.CompleteCertificateRefs</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cades.OtherCertID.html">KJUR.asn1.cades.OtherCertID</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cades.OtherHash.html">KJUR.asn1.cades.OtherHash</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cades.OtherHashAlgAndValue.html">KJUR.asn1.cades.OtherHashAlgAndValue</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cades.SignaturePolicyIdentifier.html">KJUR.asn1.cades.SignaturePolicyIdentifier</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cades.SignatureTimeStamp.html">KJUR.asn1.cades.SignatureTimeStamp</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.html">KJUR.asn1.cms</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.Attribute.html">KJUR.asn1.cms.Attribute</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.AttributeList.html">KJUR.asn1.cms.AttributeList</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.CMSUtil.html">KJUR.asn1.cms.CMSUtil</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.ContentInfo.html">KJUR.asn1.cms.ContentInfo</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.ContentType.html">KJUR.asn1.cms.ContentType</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.EncapsulatedContentInfo.html">KJUR.asn1.cms.EncapsulatedContentInfo</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.IssuerAndSerialNumber.html">KJUR.asn1.cms.IssuerAndSerialNumber</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.MessageDigest.html">KJUR.asn1.cms.MessageDigest</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.SignedData.html">KJUR.asn1.cms.SignedData</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.SignerInfo.html">KJUR.asn1.cms.SignerInfo</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.SigningCertificate.html">KJUR.asn1.cms.SigningCertificate</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.SigningCertificateV2.html">KJUR.asn1.cms.SigningCertificateV2</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.cms.SigningTime.html">KJUR.asn1.cms.SigningTime</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.csr.html">KJUR.asn1.csr</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.csr.CertificationRequest.html">KJUR.asn1.csr.CertificationRequest</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.csr.CertificationRequestInfo.html">KJUR.asn1.csr.CertificationRequestInfo</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.csr.CSRUtil.html">KJUR.asn1.csr.CSRUtil</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERAbstractString.html">KJUR.asn1.DERAbstractString</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERAbstractStructured.html">KJUR.asn1.DERAbstractStructured</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERAbstractTime.html">KJUR.asn1.DERAbstractTime</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERBitString.html">KJUR.asn1.DERBitString</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERBoolean.html">KJUR.asn1.DERBoolean</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DEREnumerated.html">KJUR.asn1.DEREnumerated</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERGeneralizedTime.html">KJUR.asn1.DERGeneralizedTime</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERIA5String.html">KJUR.asn1.DERIA5String</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERInteger.html">KJUR.asn1.DERInteger</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERNull.html">KJUR.asn1.DERNull</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERNumericString.html">KJUR.asn1.DERNumericString</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERObjectIdentifier.html">KJUR.asn1.DERObjectIdentifier</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DEROctetString.html">KJUR.asn1.DEROctetString</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERPrintableString.html">KJUR.asn1.DERPrintableString</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERSequence.html">KJUR.asn1.DERSequence</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERSet.html">KJUR.asn1.DERSet</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERTaggedObject.html">KJUR.asn1.DERTaggedObject</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERTeletexString.html">KJUR.asn1.DERTeletexString</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERUTCTime.html">KJUR.asn1.DERUTCTime</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.DERUTF8String.html">KJUR.asn1.DERUTF8String</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.html">KJUR.asn1.tsp</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.AbstractTSAAdapter.html">KJUR.asn1.tsp.AbstractTSAAdapter</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.Accuracy.html">KJUR.asn1.tsp.Accuracy</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.FixedTSAAdapter.html">KJUR.asn1.tsp.FixedTSAAdapter</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.MessageImprint.html">KJUR.asn1.tsp.MessageImprint</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.PKIFailureInfo.html">KJUR.asn1.tsp.PKIFailureInfo</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.PKIFreeText.html">KJUR.asn1.tsp.PKIFreeText</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.PKIStatus.html">KJUR.asn1.tsp.PKIStatus</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.PKIStatusInfo.html">KJUR.asn1.tsp.PKIStatusInfo</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.SimpleTSAAdapter.html">KJUR.asn1.tsp.SimpleTSAAdapter</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.TimeStampReq.html">KJUR.asn1.tsp.TimeStampReq</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.TimeStampResp.html">KJUR.asn1.tsp.TimeStampResp</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.TSPUtil.html">KJUR.asn1.tsp.TSPUtil</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.tsp.TSTInfo.html">KJUR.asn1.tsp.TSTInfo</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.html">KJUR.asn1.x509</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.AlgorithmIdentifier.html">KJUR.asn1.x509.AlgorithmIdentifier</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.AttributeTypeAndValue.html">KJUR.asn1.x509.AttributeTypeAndValue</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.AuthorityKeyIdentifier.html">KJUR.asn1.x509.AuthorityKeyIdentifier</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.BasicConstraints.html">KJUR.asn1.x509.BasicConstraints</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.Certificate.html">KJUR.asn1.x509.Certificate</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.CRL.html">KJUR.asn1.x509.CRL</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.CRLDistributionPoints.html">KJUR.asn1.x509.CRLDistributionPoints</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.CRLEntry.html">KJUR.asn1.x509.CRLEntry</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.DistributionPoint.html">KJUR.asn1.x509.DistributionPoint</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.DistributionPointName.html">KJUR.asn1.x509.DistributionPointName</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.Extension.html">KJUR.asn1.x509.Extension</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.ExtKeyUsage.html">KJUR.asn1.x509.ExtKeyUsage</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.GeneralName.html">KJUR.asn1.x509.GeneralName</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.GeneralNames.html">KJUR.asn1.x509.GeneralNames</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.KeyUsage.html">KJUR.asn1.x509.KeyUsage</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.OID.html">KJUR.asn1.x509.OID</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.RDN.html">KJUR.asn1.x509.RDN</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.SubjectPublicKeyInfo.html">KJUR.asn1.x509.SubjectPublicKeyInfo</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.TBSCertificate.html">KJUR.asn1.x509.TBSCertificate</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.TBSCertList.html">KJUR.asn1.x509.TBSCertList</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.Time.html">KJUR.asn1.x509.Time</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.X500Name.html">KJUR.asn1.x509.X500Name</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.asn1.x509.X509Util.html">KJUR.asn1.x509.X509Util</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.crypto.html">KJUR.crypto</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.crypto.DSA.html">KJUR.crypto.DSA</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.crypto.ECDSA.html">KJUR.crypto.ECDSA</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.crypto.ECParameterDB.html">KJUR.crypto.ECParameterDB</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.crypto.Mac.html">KJUR.crypto.Mac</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.crypto.MessageDigest.html">KJUR.crypto.MessageDigest</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.crypto.OID.html">KJUR.crypto.OID</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.crypto.Signature.html">KJUR.crypto.Signature</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.crypto.Util.html">KJUR.crypto.Util</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.jws.html">KJUR.jws</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.jws.IntDate.html">KJUR.jws.IntDate</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.jws.JWS.html">KJUR.jws.JWS</a></li>
|
||
|
|
||
|
<li><a href="../symbols/KJUR.jws.JWSJS.html">KJUR.jws.JWSJS</a></li>
|
||
|
|
||
|
<li><a href="../symbols/PKCS5PKEY.html">PKCS5PKEY</a></li>
|
||
|
|
||
|
<li><a href="../symbols/RSAKey.html">RSAKey</a></li>
|
||
|
|
||
|
<li><a href="../symbols/X509.html">X509</a></li>
|
||
|
|
||
|
</ul>
|
||
|
<hr />
|
||
|
<!-- end publish.classesIndex -->
|
||
|
</div>
|
||
|
|
||
|
<div id="content">
|
||
|
<!-- ============================== class title ============================ -->
|
||
|
<h1 class="classTitle">
|
||
|
|
||
|
Class X509
|
||
|
</h1>
|
||
|
|
||
|
<!-- ============================== class summary ========================== -->
|
||
|
<p class="description">
|
||
|
<br />Version
|
||
|
1.0.1 (08 May 2012).<br />
|
||
|
|
||
|
|
||
|
|
||
|
hexadecimal X.509 certificate ASN.1 parser class
|
||
|
|
||
|
|
||
|
<br /><i>Defined in: </i> <a href="../symbols/src/x509-1.1.js.html">x509-1.1.js</a>.
|
||
|
|
||
|
</p>
|
||
|
|
||
|
<!-- ============================== constructor summary ==================== -->
|
||
|
|
||
|
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class X509.">
|
||
|
<caption>Class Summary</caption>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th scope="col">Constructor Attributes</th>
|
||
|
<th scope="col">Constructor Name and Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription" >
|
||
|
<div class="fixedFont">
|
||
|
<b><a href="../symbols/X509.html#constructor">X509</a></b>()
|
||
|
</div>
|
||
|
<div class="description">hexadecimal X.509 certificate ASN.1 parser class.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
|
||
|
<!-- ============================== properties summary ===================== -->
|
||
|
|
||
|
|
||
|
|
||
|
<table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class X509.">
|
||
|
<caption>Field Summary</caption>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th scope="col">Field Attributes</th>
|
||
|
<th scope="col">Field Name and Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">
|
||
|
<b><a href="../symbols/X509.html#hex">hex</a></b>
|
||
|
</div>
|
||
|
<div class="description">hexacedimal string for X.509 certificate.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">
|
||
|
<b><a href="../symbols/X509.html#subjectPublicKeyRSA">subjectPublicKeyRSA</a></b>
|
||
|
</div>
|
||
|
<div class="description">Tom Wu's RSAKey object</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">
|
||
|
<b><a href="../symbols/X509.html#subjectPublicKeyRSA_hE">subjectPublicKeyRSA_hE</a></b>
|
||
|
</div>
|
||
|
<div class="description">hexadecimal string for public exponent of RSA public key</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">
|
||
|
<b><a href="../symbols/X509.html#subjectPublicKeyRSA_hN">subjectPublicKeyRSA_hN</a></b>
|
||
|
</div>
|
||
|
<div class="description">hexadecimal string for modulus of RSA public key</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<!-- ============================== methods summary ======================== -->
|
||
|
|
||
|
|
||
|
|
||
|
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class X509.">
|
||
|
<caption>Method Summary</caption>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th scope="col">Method Attributes</th>
|
||
|
<th scope="col">Method Name and Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getExtAIAInfo">getExtAIAInfo</a></b>(hCert)
|
||
|
</div>
|
||
|
<div class="description">get AuthorityInfoAccess extension value in the certificate as associative array
|
||
|
This method will get authority info access value
|
||
|
as associate array which has following properties:
|
||
|
<ul>
|
||
|
<li>ocsp - array of string for OCSP responder URL</li>
|
||
|
<li>caissuer - array of string for caIssuer value (i.e.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getExtAuthorityKeyIdentifier">getExtAuthorityKeyIdentifier</a></b>(hCert)
|
||
|
</div>
|
||
|
<div class="description">get authorityKeyIdentifier value as JSON object in the certificate
|
||
|
This method will get authority key identifier extension value
|
||
|
as JSON object.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getExtBasicConstraints">getExtBasicConstraints</a></b>(hCert)
|
||
|
</div>
|
||
|
<div class="description">get BasicConstraints extension value as object in the certificate
|
||
|
This method will get basic constraints extension value as object with following paramters.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getExtCRLDistributionPointsURI">getExtCRLDistributionPointsURI</a></b>(hCert)
|
||
|
</div>
|
||
|
<div class="description">get array of string for fullName URIs in cRLDistributionPoints(CDP) in the certificate
|
||
|
This method will get all fullName URIs of cRLDistributionPoints extension
|
||
|
in the certificate as array of URI string.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getExtExtKeyUsageName">getExtExtKeyUsageName</a></b>(hCert)
|
||
|
</div>
|
||
|
<div class="description">get extKeyUsage value as array of name string in the certificate
|
||
|
This method will get extended key usage extension value
|
||
|
as array of name or OID string.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getExtKeyUsageBin">getExtKeyUsageBin</a></b>(hCert)
|
||
|
</div>
|
||
|
<div class="description">get KeyUsage extension value as binary string in the certificate
|
||
|
This method will get key usage extension value
|
||
|
as binary string such like '101'.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getExtKeyUsageString">getExtKeyUsageString</a></b>(hCert)
|
||
|
</div>
|
||
|
<div class="description">get KeyUsage extension value as names in the certificate
|
||
|
This method will get key usage extension value
|
||
|
as comma separated string of usage names.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getExtSubjectAltName">getExtSubjectAltName</a></b>(hCert)
|
||
|
</div>
|
||
|
<div class="description">get subjectAltName value as array of string in the certificate
|
||
|
This method will get subject alt name extension value
|
||
|
as array of name.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getExtSubjectKeyIdentifier">getExtSubjectKeyIdentifier</a></b>(hCert)
|
||
|
</div>
|
||
|
<div class="description">get subjectKeyIdentifier value as hexadecimal string in the certificate
|
||
|
This method will get subject key identifier extension value
|
||
|
as hexadecimal string.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getHexOfTLV_V3ExtValue">getHexOfTLV_V3ExtValue</a></b>(hCert, oidOrName)
|
||
|
</div>
|
||
|
<div class="description">get X.509 V3 extension value ASN.1 TLV for specified oid or name
|
||
|
This method will get X.509v3 extension value of ASN.1 TLV
|
||
|
which is specifyed by extension name or oid.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getHexOfV_V3ExtValue">getHexOfV_V3ExtValue</a></b>(hCert, oidOrName)
|
||
|
</div>
|
||
|
<div class="description">get X.509 V3 extension value ASN.1 V for specified oid or name
|
||
|
This method will get X.509v3 extension value of ASN.1 value
|
||
|
which is specifyed by extension name or oid.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont"><b><a href="../symbols/X509.html#getInfo">getInfo</a></b>()
|
||
|
</div>
|
||
|
<div class="description">get certificate information as string.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont"><b><a href="../symbols/X509.html#getIssuerHex">getIssuerHex</a></b>()
|
||
|
</div>
|
||
|
<div class="description">get hexadecimal string of issuer field TLV of certificate.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont"><b><a href="../symbols/X509.html#getIssuerString">getIssuerString</a></b>()
|
||
|
</div>
|
||
|
<div class="description">get string of issuer field of certificate.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont"><b><a href="../symbols/X509.html#getNotAfter">getNotAfter</a></b>()
|
||
|
</div>
|
||
|
<div class="description">get notAfter field string of certificate.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont"><b><a href="../symbols/X509.html#getNotBefore">getNotBefore</a></b>()
|
||
|
</div>
|
||
|
<div class="description">get notBefore field string of certificate.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getPosOfTLV_V3ExtValue">getPosOfTLV_V3ExtValue</a></b>(hCert, oidOrName)
|
||
|
</div>
|
||
|
<div class="description">get index in the certificate hexa string for specified oid or name specified extension
|
||
|
This method will get X.509v3 extension value of ASN.1 V(value)
|
||
|
which is specifyed by extension name or oid.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getPublicKeyFromCertPEM">getPublicKeyFromCertPEM</a></b>(sCertPEM)
|
||
|
</div>
|
||
|
<div class="description">get RSAKey/ECDSA public key object from PEM certificate string
|
||
|
NOTE: DSA is also supported since x509 1.1.2.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getPublicKeyInfoPosOfCertHEX">getPublicKeyInfoPosOfCertHEX</a></b>(hCert)
|
||
|
</div>
|
||
|
<div class="description">get position of subjectPublicKeyInfo field from HEX certificate
|
||
|
get position for SubjectPublicKeyInfo field in the hexadecimal string of
|
||
|
certificate.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getPublicKeyInfoPropOfCertPEM">getPublicKeyInfoPropOfCertPEM</a></b>(sCertPEM)
|
||
|
</div>
|
||
|
<div class="description">get public key information from PEM certificate
|
||
|
Resulted associative array has following properties:<br/>
|
||
|
<ul>
|
||
|
<li>algoid - hexadecimal string of OID of asymmetric key algorithm</li>
|
||
|
<li>algparam - hexadecimal string of OID of ECC curve name or null</li>
|
||
|
<li>keyhex - hexadecimal string of key in the certificate</li>
|
||
|
</ul>
|
||
|
NOTE: X509v1 certificate is also supported since x509.js 1.1.9.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont"><b><a href="../symbols/X509.html#getSerialNumberHex">getSerialNumberHex</a></b>()
|
||
|
</div>
|
||
|
<div class="description">get hexadecimal string of serialNumber field of certificate.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont"><b><a href="../symbols/X509.html#getSignatureAlgorithmField">getSignatureAlgorithmField</a></b>()
|
||
|
</div>
|
||
|
<div class="description">get signature algorithm name in basic field
|
||
|
This method will get a name of signature algorithm field of certificate:</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getSignatureAlgorithmName">getSignatureAlgorithmName</a></b>(hCert)
|
||
|
</div>
|
||
|
<div class="description">get signature algorithm name from hexadecimal certificate data
|
||
|
This method will get signature algorithm name of certificate:</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getSignatureValueHex">getSignatureValueHex</a></b>(hCert)
|
||
|
</div>
|
||
|
<div class="description">get signature value in hexadecimal string
|
||
|
This method will get signature value of certificate:</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont"><b><a href="../symbols/X509.html#getSubjectHex">getSubjectHex</a></b>()
|
||
|
</div>
|
||
|
<div class="description">get hexadecimal string of subject field of certificate.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont"><b><a href="../symbols/X509.html#getSubjectString">getSubjectString</a></b>()
|
||
|
</div>
|
||
|
<div class="description">get string of subject field of certificate.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getV3ExtInfoListOfCertHex">getV3ExtInfoListOfCertHex</a></b>(hCert)
|
||
|
</div>
|
||
|
<div class="description">get array of X.509 V3 extension value information in hex string of certificate
|
||
|
This method will get all extension information of a X.509 certificate.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.getV3ExtItemInfo_AtObj">getV3ExtItemInfo_AtObj</a></b>(hCert, pos)
|
||
|
</div>
|
||
|
<div class="description">get X.509 V3 extension value information at the specified position
|
||
|
This method will get some information of a X.509 V extension
|
||
|
which is referred by an index of hexadecimal string of X.509
|
||
|
certificate.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.pemToBase64">pemToBase64</a></b>(sCertPEM)
|
||
|
</div>
|
||
|
<div class="description">get Base64 string from PEM certificate string</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"><static> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont">X509.<b><a href="../symbols/X509.html#.pemToHex">pemToHex</a></b>(sCertPEM)
|
||
|
</div>
|
||
|
<div class="description">get a hexa decimal string from PEM certificate string</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td class="attributes"> </td>
|
||
|
<td class="nameDescription">
|
||
|
<div class="fixedFont"><b><a href="../symbols/X509.html#readCertPEM">readCertPEM</a></b>(sCertPEM)
|
||
|
</div>
|
||
|
<div class="description">read PEM formatted X.509 certificate from string.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<!-- ============================== events summary ======================== -->
|
||
|
|
||
|
|
||
|
<!-- ============================== constructor details ==================== -->
|
||
|
|
||
|
<div class="details"><a name="constructor"> </a>
|
||
|
<div class="sectionTitle">
|
||
|
Class Detail
|
||
|
</div>
|
||
|
|
||
|
<div class="fixedFont">
|
||
|
<b>X509</b>()
|
||
|
</div>
|
||
|
|
||
|
<div class="description">
|
||
|
hexadecimal X.509 certificate ASN.1 parser class.<br/>
|
||
|
X509 class provides following functionality:
|
||
|
<ul>
|
||
|
<li>parse X.509 certificate ASN.1 structure</li>
|
||
|
<li>get basic fields, extensions, signature algorithms and signature values</li>
|
||
|
<li>read PEM certificate</li>
|
||
|
</ul>
|
||
|
|
||
|
<ul>
|
||
|
<li><b>TO GET FIELDS</b>
|
||
|
<ul>
|
||
|
<li>serial - <a href="../symbols/X509.html#getSerialNumberHex">X509#getSerialNumberHex</a></li>
|
||
|
<li>issuer - <a href="../symbols/X509.html#getIssuerHex">X509#getIssuerHex</a></li>
|
||
|
<li>issuer - <a href="../symbols/X509.html#getIssuerString">X509#getIssuerString</a></li>
|
||
|
<li>notBefore - <a href="../symbols/X509.html#getNotBefore">X509#getNotBefore</a></li>
|
||
|
<li>notAfter - <a href="../symbols/X509.html#getNotAfter">X509#getNotAfter</a></li>
|
||
|
<li>subject - <a href="../symbols/X509.html#getSubjectHex">X509#getSubjectHex</a></li>
|
||
|
<li>subject - <a href="../symbols/X509.html#getSubjectString">X509#getSubjectString</a></li>
|
||
|
<li>subjectPublicKeyInfo - X509.getSubjectPublicKeyPosFromCertHex</li>
|
||
|
<li>subjectPublicKeyInfo - X509.getSubjectPublicKeyInfoPosFromCertHex</li>
|
||
|
<li>subjectPublicKeyInfo - <a href="../symbols/X509.html#.getPublicKeyFromCertPEM">X509.getPublicKeyFromCertPEM</a></li>
|
||
|
<li>signature algorithm - <a href="../symbols/X509.html#.getSignatureAlgorithmName">X509.getSignatureAlgorithmName</a></li>
|
||
|
<li>signature value - <a href="../symbols/X509.html#.getSignatureValueHex">X509.getSignatureValueHex</a></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li><b>TO GET EXTENSIONS</b>
|
||
|
<ul>
|
||
|
<li>basicConstraints - <a href="../symbols/X509.html#.getExtBasicConstraints">X509.getExtBasicConstraints</a></li>
|
||
|
<li>keyUsage - <a href="../symbols/X509.html#.getExtKeyUsageBin">X509.getExtKeyUsageBin</a></li>
|
||
|
<li>keyUsage - <a href="../symbols/X509.html#.getExtKeyUsageString">X509.getExtKeyUsageString</a></li>
|
||
|
<li>subjectKeyIdentifier - <a href="../symbols/X509.html#.getExtSubjectKeyIdentifier">X509.getExtSubjectKeyIdentifier</a></li>
|
||
|
<li>authorityKeyIdentifier - <a href="../symbols/X509.html#.getExtAuthorityKeyIdentifier">X509.getExtAuthorityKeyIdentifier</a></li>
|
||
|
<li>extKeyUsage - <a href="../symbols/X509.html#.getExtExtKeyUsageName">X509.getExtExtKeyUsageName</a></li>
|
||
|
<li>subjectAltName - <a href="../symbols/X509.html#.getExtSubjectAltName">X509.getExtSubjectAltName</a></li>
|
||
|
<li>cRLDistributionPoints - <a href="../symbols/X509.html#.getExtCRLDistributionPointsURI">X509.getExtCRLDistributionPointsURI</a></li>
|
||
|
<li>authorityInfoAccess - <a href="../symbols/X509.html#.getExtAIAInfo">X509.getExtAIAInfo</a></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li><b>UTILITIES</b>
|
||
|
<ul>
|
||
|
<li>reading PEM certificate - <a href="../symbols/X509.html#readCertPEM">X509#readCertPEM</a></li>
|
||
|
<li>get all certificate information - <a href="../symbols/X509.html#getInfo">X509#getInfo</a></li>
|
||
|
<li>get Base64 from PEM certificate - <a href="../symbols/X509.html#.pemToBase64">X509.pemToBase64</a></li>
|
||
|
<li>get hexadecimal string from PEM certificate - <a href="../symbols/X509.html#.pemToHex">X509.pemToHex</a></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<br /><i>Author: </i>Kenji Urushima.
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">See:</dt>
|
||
|
|
||
|
<dd><a href="http://kjur.github.com/jsrsasigns/">'jsrsasign'(RSA Sign JavaScript Library) home page http://kjur.github.com/jsrsasign/</a></dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<!-- ============================== field details ========================== -->
|
||
|
|
||
|
<div class="sectionTitle">
|
||
|
Field Detail
|
||
|
</div>
|
||
|
|
||
|
<a name="hex"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<b>hex</b>
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
hexacedimal string for X.509 certificate.
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name="subjectPublicKeyRSA"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
<span class="light">{<a href="../symbols/RSAKey.html">RSAKey</a>}</span>
|
||
|
<b>subjectPublicKeyRSA</b>
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
Tom Wu's RSAKey object
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name="subjectPublicKeyRSA_hE"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<b>subjectPublicKeyRSA_hE</b>
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
hexadecimal string for public exponent of RSA public key
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name="subjectPublicKeyRSA_hN"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<b>subjectPublicKeyRSA_hN</b>
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
hexadecimal string for modulus of RSA public key
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<!-- ============================== method details ========================= -->
|
||
|
|
||
|
<div class="sectionTitle">
|
||
|
Method Detail
|
||
|
</div>
|
||
|
|
||
|
<a name=".getExtAIAInfo"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{Object}</span>
|
||
|
<span class="light">X509.</span><b>getExtAIAInfo</b>(hCert)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get AuthorityInfoAccess extension value in the certificate as associative array
|
||
|
This method will get authority info access value
|
||
|
as associate array which has following properties:
|
||
|
<ul>
|
||
|
<li>ocsp - array of string for OCSP responder URL</li>
|
||
|
<li>caissuer - array of string for caIssuer value (i.e. CA certificates URL)</li>
|
||
|
</ul>
|
||
|
If there is no key usage extension in the certificate,
|
||
|
it returns null;
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">oAIA = X509.getExtAIAInfo(hCert);
|
||
|
// result will be such like:
|
||
|
// oAIA.ocsp = ["http://ocsp.foo.com"];
|
||
|
// oAIA.caissuer = ["http://rep.foo.com/aaa.p8m"];</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.6</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{Object}</span> associative array of AIA extension properties</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getExtAuthorityKeyIdentifier"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{Object}</span>
|
||
|
<span class="light">X509.</span><b>getExtAuthorityKeyIdentifier</b>(hCert)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get authorityKeyIdentifier value as JSON object in the certificate
|
||
|
This method will get authority key identifier extension value
|
||
|
as JSON object.
|
||
|
If there is no its extension in the certificate,
|
||
|
it returns null.
|
||
|
<br>
|
||
|
NOTE: Currently this method only supports keyIdentifier so that
|
||
|
authorityCertIssuer and authorityCertSerialNumber will not
|
||
|
be return in the JSON object.
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">akid = X509.getExtAuthorityKeyIdentifier(hCert);
|
||
|
// returns following JSON object
|
||
|
{ kid: "1234abcd..." }</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>jsrsasign 5.0.10 x509 1.1.8</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{Object}</span> JSON object of authority key identifier or null</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getExtBasicConstraints"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{Object}</span>
|
||
|
<span class="light">X509.</span><b>getExtBasicConstraints</b>(hCert)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get BasicConstraints extension value as object in the certificate
|
||
|
This method will get basic constraints extension value as object with following paramters.
|
||
|
<ul>
|
||
|
<li>cA - CA flag whether CA or not</li>
|
||
|
<li>pathLen - maximum intermediate certificate length</li>
|
||
|
</ul>
|
||
|
There are use cases for return values:
|
||
|
<ul>
|
||
|
<li>{cA:true, pathLen:3} - cA flag is true and pathLen is 3</li>
|
||
|
<li>{cA:true} - cA flag is true and no pathLen</li>
|
||
|
<li>{} - basic constraints has no value in case of end entity certificate</li>
|
||
|
<li>null - there is no basic constraints extension</li>
|
||
|
</ul>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">obj = X509.getExtBasicConstraints(hCert);</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.7</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{Object}</span> associative array which may have "cA" and "pathLen" parameters</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getExtCRLDistributionPointsURI"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{Object}</span>
|
||
|
<span class="light">X509.</span><b>getExtCRLDistributionPointsURI</b>(hCert)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get array of string for fullName URIs in cRLDistributionPoints(CDP) in the certificate
|
||
|
This method will get all fullName URIs of cRLDistributionPoints extension
|
||
|
in the certificate as array of URI string.
|
||
|
If there is no its extension in the certificate,
|
||
|
it returns null.
|
||
|
<br>
|
||
|
NOTE: Currently this method supports only fullName URI so that
|
||
|
other parameters will not be returned.
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">cdpuri = X509.getExtCRLDistributionPointsURI(hCert);
|
||
|
// returns following array:
|
||
|
["http://example.com/aaa.crl", "http://example.org/aaa.crl"]</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>jsrsasign 5.0.10 x509 1.1.8</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{Object}</span> array of fullName URIs of CDP of the certificate</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getExtExtKeyUsageName"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{Object}</span>
|
||
|
<span class="light">X509.</span><b>getExtExtKeyUsageName</b>(hCert)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get extKeyUsage value as array of name string in the certificate
|
||
|
This method will get extended key usage extension value
|
||
|
as array of name or OID string.
|
||
|
If there is no its extension in the certificate,
|
||
|
it returns null.
|
||
|
<br>
|
||
|
NOTE: Supported extended key usage ID names are defined in
|
||
|
name2oidList parameter in asn1x509.js file.
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">eku = X509.getExtExtKeyUsageName(hCert);
|
||
|
// returns following array:
|
||
|
["serverAuth", "clientAuth", "0.1.2.3.4.5"]</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>jsrsasign 5.0.10 x509 1.1.8</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{Object}</span> array of extended key usage ID name or oid</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getExtKeyUsageBin"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<span class="light">X509.</span><b>getExtKeyUsageBin</b>(hCert)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get KeyUsage extension value as binary string in the certificate
|
||
|
This method will get key usage extension value
|
||
|
as binary string such like '101'.
|
||
|
Key usage bits definition is in the RFC 5280.
|
||
|
If there is no key usage extension in the certificate,
|
||
|
it returns empty string (i.e. '').
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">bKeyUsage = X509.getExtKeyUsageBin(hCert);
|
||
|
// bKeyUsage will be such like '101'.
|
||
|
// 1 - digitalSignature
|
||
|
// 0 - nonRepudiation
|
||
|
// 1 - keyEncipherment</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.6</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> binary string of key usage bits (ex. '101')</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getExtKeyUsageString"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<span class="light">X509.</span><b>getExtKeyUsageString</b>(hCert)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get KeyUsage extension value as names in the certificate
|
||
|
This method will get key usage extension value
|
||
|
as comma separated string of usage names.
|
||
|
If there is no key usage extension in the certificate,
|
||
|
it returns empty string (i.e. '').
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">sKeyUsage = X509.getExtKeyUsageString(hCert);
|
||
|
// sKeyUsage will be such like 'digitalSignature,keyEncipherment'.</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.6</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> comma separated string of key usage</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getExtSubjectAltName"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{Object}</span>
|
||
|
<span class="light">X509.</span><b>getExtSubjectAltName</b>(hCert)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get subjectAltName value as array of string in the certificate
|
||
|
This method will get subject alt name extension value
|
||
|
as array of name.
|
||
|
If there is no its extension in the certificate,
|
||
|
it returns null.
|
||
|
<br>
|
||
|
NOTE: Currently this method supports only dNSName so that
|
||
|
other name type such like iPAddress or generalName will not be returned.
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">san = X509.getExtSubjectAltName(hCert);
|
||
|
// returns following array:
|
||
|
["example.com", "example.org"]</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>jsrsasign 5.0.10 x509 1.1.8</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{Object}</span> array of alt names</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getExtSubjectKeyIdentifier"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<span class="light">X509.</span><b>getExtSubjectKeyIdentifier</b>(hCert)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get subjectKeyIdentifier value as hexadecimal string in the certificate
|
||
|
This method will get subject key identifier extension value
|
||
|
as hexadecimal string.
|
||
|
If there is no its extension in the certificate,
|
||
|
it returns null.
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">skid = X509.getExtSubjectKeyIdentifier(hCert);</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>jsrsasign 5.0.10 x509 1.1.8</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> hexadecimal string of subject key identifier or null</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getHexOfTLV_V3ExtValue"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<span class="light">X509.</span><b>getHexOfTLV_V3ExtValue</b>(hCert, oidOrName)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get X.509 V3 extension value ASN.1 TLV for specified oid or name
|
||
|
This method will get X.509v3 extension value of ASN.1 TLV
|
||
|
which is specifyed by extension name or oid.
|
||
|
If there is no such extension in the certificate, it returns null.
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">hExtValue = X509.getHexOfTLV_V3ExtValue(hCert, "keyUsage");
|
||
|
// hExtValue will be such like '030205a0'.</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>oidOrName</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>oid or name for extension (ex. 'keyUsage' or '2.5.29.15')</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.6</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> hexadecimal string of extension ASN.1 TLV</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getHexOfV_V3ExtValue"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<span class="light">X509.</span><b>getHexOfV_V3ExtValue</b>(hCert, oidOrName)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get X.509 V3 extension value ASN.1 V for specified oid or name
|
||
|
This method will get X.509v3 extension value of ASN.1 value
|
||
|
which is specifyed by extension name or oid.
|
||
|
If there is no such extension in the certificate, it returns null.
|
||
|
Available extension names and oids are defined
|
||
|
in the <a href="../symbols/KJUR.asn1.x509.OID.html">KJUR.asn1.x509.OID</a> class.
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">hExtValue = X509.getHexOfV_V3ExtValue(hCert, "keyUsage");
|
||
|
// hExtValue will be such like '05a0'.</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>oidOrName</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>oid or name for extension (ex. 'keyUsage' or '2.5.29.15')</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.6</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> hexadecimal string of extension ASN.1 TLV</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name="getInfo"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<b>getInfo</b>()
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get certificate information as string.<br/>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">x = new X509();
|
||
|
x.readCertPEM(certPEM);
|
||
|
console.log(x.getInfo());
|
||
|
// this shows as following
|
||
|
Basic Fields
|
||
|
serial number: 02ac5c266a0b409b8f0b79f2ae462577
|
||
|
signature algorithm: SHA1withRSA
|
||
|
issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
|
||
|
notBefore: 061110000000Z
|
||
|
notAfter: 311110000000Z
|
||
|
subject: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
|
||
|
subject public key info:
|
||
|
key algorithm: RSA
|
||
|
n=c6cce573e6fbd4bb...
|
||
|
e=10001
|
||
|
X509v3 Extensions:
|
||
|
keyUsage CRITICAL:
|
||
|
digitalSignature,keyCertSign,cRLSign
|
||
|
basicConstraints CRITICAL:
|
||
|
cA=true
|
||
|
subjectKeyIdentifier :
|
||
|
b13ec36903f8bf4701d498261a0802ef63642bc3
|
||
|
authorityKeyIdentifier :
|
||
|
kid=b13ec36903f8bf4701d498261a0802ef63642bc3
|
||
|
signature algorithm: SHA1withRSA
|
||
|
signature: 1c1a0697dcd79c9f...</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>jsrsasign 5.0.10 x509 1.1.8</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> certificate information string</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name="getIssuerHex"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<b>getIssuerHex</b>()
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get hexadecimal string of issuer field TLV of certificate.<br/>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">var x = new X509();
|
||
|
x.readCertPEM(sCertPEM);
|
||
|
var issuer = x.getIssuerHex(); // return string like "3013..."</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> hexadecial string of issuer DN ASN.1</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name="getIssuerString"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<b>getIssuerString</b>()
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get string of issuer field of certificate.<br/>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">var x = new X509();
|
||
|
x.readCertPEM(sCertPEM);
|
||
|
var issuer = x.getIssuerString(); // return string like "/C=US/O=TEST"</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> issuer DN string</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name="getNotAfter"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<b>getNotAfter</b>()
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get notAfter field string of certificate.<br/>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">var x = new X509();
|
||
|
x.readCertPEM(sCertPEM);
|
||
|
var notAfter = x.getNotAfter(); // return string like "151231235959Z"</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> not after time value (ex. "151231235959Z")</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name="getNotBefore"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<b>getNotBefore</b>()
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get notBefore field string of certificate.<br/>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">var x = new X509();
|
||
|
x.readCertPEM(sCertPEM);
|
||
|
var notBefore = x.getNotBefore(); // return string like "151231235959Z"</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> not before time value (ex. "151231235959Z")</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getPosOfTLV_V3ExtValue"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{Integer}</span>
|
||
|
<span class="light">X509.</span><b>getPosOfTLV_V3ExtValue</b>(hCert, oidOrName)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get index in the certificate hexa string for specified oid or name specified extension
|
||
|
This method will get X.509v3 extension value of ASN.1 V(value)
|
||
|
which is specifyed by extension name or oid.
|
||
|
If there is no such extension in the certificate,
|
||
|
it returns -1.
|
||
|
Available extension names and oids are defined
|
||
|
in the <a href="../symbols/KJUR.asn1.x509.OID.html">KJUR.asn1.x509.OID</a> class.
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">idx = X509.getPosOfV_V3ExtValue(hCert, "keyUsage");
|
||
|
// The 'idx' will be index in the string for keyUsage value ASN.1 TLV.</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>oidOrName</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>oid or name for extension (ex. 'keyUsage' or '2.5.29.15')</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.6</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{Integer}</span> index in the hexadecimal string of certficate for specified extension</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getPublicKeyFromCertPEM"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
|
||
|
<span class="light">X509.</span><b>getPublicKeyFromCertPEM</b>(sCertPEM)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get RSAKey/ECDSA public key object from PEM certificate string
|
||
|
NOTE: DSA is also supported since x509 1.1.2.
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>sCertPEM</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>PEM formatted RSA/ECDSA/DSA X.509 certificate</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.1</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd>returns RSAKey/KJUR.crypto.{ECDSA,DSA} object of public key</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getPublicKeyInfoPosOfCertHEX"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{Integer}</span>
|
||
|
<span class="light">X509.</span><b>getPublicKeyInfoPosOfCertHEX</b>(hCert)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get position of subjectPublicKeyInfo field from HEX certificate
|
||
|
get position for SubjectPublicKeyInfo field in the hexadecimal string of
|
||
|
certificate.
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of certificate</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.4</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{Integer}</span> position in hexadecimal string</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getPublicKeyInfoPropOfCertPEM"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{Hash}</span>
|
||
|
<span class="light">X509.</span><b>getPublicKeyInfoPropOfCertPEM</b>(sCertPEM)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get public key information from PEM certificate
|
||
|
Resulted associative array has following properties:<br/>
|
||
|
<ul>
|
||
|
<li>algoid - hexadecimal string of OID of asymmetric key algorithm</li>
|
||
|
<li>algparam - hexadecimal string of OID of ECC curve name or null</li>
|
||
|
<li>keyhex - hexadecimal string of key in the certificate</li>
|
||
|
</ul>
|
||
|
NOTE: X509v1 certificate is also supported since x509.js 1.1.9.
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>sCertPEM</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>string of PEM formatted certificate</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.1</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{Hash}</span> hash of information for public key</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name="getSerialNumberHex"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<b>getSerialNumberHex</b>()
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get hexadecimal string of serialNumber field of certificate.<br/>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">var x = new X509();
|
||
|
x.readCertPEM(sCertPEM);
|
||
|
var sn = x.getSerialNumberHex(); // return string like "01ad..."</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> hexadecimal string of certificate serial number</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name="getSignatureAlgorithmField"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<b>getSignatureAlgorithmField</b>()
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get signature algorithm name in basic field
|
||
|
This method will get a name of signature algorithm field of certificate:
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">var x = new X509();
|
||
|
x.readCertPEM(sCertPEM);
|
||
|
algName = x.getSignatureAlgorithmField();</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.8</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> signature algorithm name (ex. SHA1withRSA, SHA256withECDSA)</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getSignatureAlgorithmName"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<span class="light">X509.</span><b>getSignatureAlgorithmName</b>(hCert)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get signature algorithm name from hexadecimal certificate data
|
||
|
This method will get signature algorithm name of certificate:
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">algName = X509.getSignatureAlgorithmName(hCert);</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.7</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> signature algorithm name (ex. SHA1withRSA, SHA256withECDSA)</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getSignatureValueHex"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<span class="light">X509.</span><b>getSignatureValueHex</b>(hCert)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get signature value in hexadecimal string
|
||
|
This method will get signature value of certificate:
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">sigHex = X509.getSignatureValueHex(hCert);</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.7</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> signature value hexadecimal string without BitString unused bits</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name="getSubjectHex"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<b>getSubjectHex</b>()
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get hexadecimal string of subject field of certificate.<br/>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">var x = new X509();
|
||
|
x.readCertPEM(sCertPEM);
|
||
|
var subject = x.getSubjectHex(); // return string like "3013..."</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> hexadecial string of subject DN ASN.1</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name="getSubjectString"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<b>getSubjectString</b>()
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get string of subject field of certificate.<br/>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">var x = new X509();
|
||
|
x.readCertPEM(sCertPEM);
|
||
|
var subject = x.getSubjectString(); // return string like "/C=US/O=TEST"</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> subject DN string</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getV3ExtInfoListOfCertHex"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{Array}</span>
|
||
|
<span class="light">X509.</span><b>getV3ExtInfoListOfCertHex</b>(hCert)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get array of X.509 V3 extension value information in hex string of certificate
|
||
|
This method will get all extension information of a X.509 certificate.
|
||
|
Items of resulting array has following properties:
|
||
|
<ul>
|
||
|
<li>posTLV - index of ASN.1 TLV for the extension. same as 'pos' argument.</li>
|
||
|
<li>oid - dot noted string of extension oid (ex. 2.5.29.14)</li>
|
||
|
<li>critical - critical flag value for this extension</li>
|
||
|
<li>posV - index of ASN.1 TLV for the extension value.
|
||
|
This is a position of a content of ENCAPSULATED OCTET STRING.</li>
|
||
|
</ul>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">hCert = X509.pemToHex(certGithubPEM);
|
||
|
a = X509.getV3ExtInfoListOfCertHex(hCert);
|
||
|
// Then a will be an array of like following:
|
||
|
[{posTLV: 1952, oid: "2.5.29.35", critical: false, posV: 1968},
|
||
|
{posTLV: 1974, oid: "2.5.29.19", critical: true, posV: 1986}, ...]</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.5</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{Array}</span> array of result object by <a href="../symbols/X509.html#.getV3ExtInfoListOfCertHex">X509.getV3ExtInfoListOfCertHex</a></dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".getV3ExtItemInfo_AtObj"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{Object}</span>
|
||
|
<span class="light">X509.</span><b>getV3ExtItemInfo_AtObj</b>(hCert, pos)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get X.509 V3 extension value information at the specified position
|
||
|
This method will get some information of a X.509 V extension
|
||
|
which is referred by an index of hexadecimal string of X.509
|
||
|
certificate.
|
||
|
Resulting object has following properties:
|
||
|
<ul>
|
||
|
<li>posTLV - index of ASN.1 TLV for the extension. same as 'pos' argument.</li>
|
||
|
<li>oid - dot noted string of extension oid (ex. 2.5.29.14)</li>
|
||
|
<li>critical - critical flag value for this extension</li>
|
||
|
<li>posV - index of ASN.1 TLV for the extension value.
|
||
|
This is a position of a content of ENCAPSULATED OCTET STRING.</li>
|
||
|
</ul>
|
||
|
This method is used by <a href="../symbols/X509.html#.getV3ExtInfoListOfCertHex">X509.getV3ExtInfoListOfCertHex</a> internally.
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>hCert</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>hexadecimal string of X.509 certificate binary</dd>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{Integer}</span> <b>pos</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>index of hexadecimal string for the extension</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Since:</dt>
|
||
|
<dd>x509 1.1.5</dd>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{Object}</span> properties for the extension</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".pemToBase64"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<span class="light">X509.</span><b>pemToBase64</b>(sCertPEM)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get Base64 string from PEM certificate string
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">b64 = X509.pemToBase64(certPEM);</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>sCertPEM</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>PEM formatted RSA/ECDSA/DSA X.509 certificate</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> Base64 string of PEM certificate</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name=".pemToHex"> </a>
|
||
|
<div class="fixedFont"><static>
|
||
|
|
||
|
<span class="light">{String}</span>
|
||
|
<span class="light">X509.</span><b>pemToHex</b>(sCertPEM)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
get a hexa decimal string from PEM certificate string
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">hex = X509.pemToHex(certPEM);</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>sCertPEM</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>PEM formatted RSA/ECDSA/DSA X.509 certificate</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Returns:</dt>
|
||
|
|
||
|
<dd><span class="light fixedFont">{String}</span> hexadecimal string of PEM certificate</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
|
||
|
<a name="readCertPEM"> </a>
|
||
|
<div class="fixedFont">
|
||
|
|
||
|
|
||
|
<b>readCertPEM</b>(sCertPEM)
|
||
|
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
read PEM formatted X.509 certificate from string.<br/>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<pre class="code">x = new X509();
|
||
|
x.readCertPEM(sCertPEM); // read certificate</pre>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<dl class="detailList">
|
||
|
<dt class="heading">Parameters:</dt>
|
||
|
|
||
|
<dt>
|
||
|
<span class="light fixedFont">{String}</span> <b>sCertPEM</b>
|
||
|
|
||
|
</dt>
|
||
|
<dd>string for PEM formatted X.509 certificate</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<!-- ============================== event details ========================= -->
|
||
|
|
||
|
|
||
|
<hr />
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<!-- ============================== footer ================================= -->
|
||
|
<div class="fineprint" style="clear:both">
|
||
|
© 2012-2015 Kenji Urushima, All rights reserved<br/>
|
||
|
|
||
|
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|