ProxyCertInfo ::= SEQUENCE { pCPathLenConstraint INTEGER (0..MAX) OPTIONAL, proxyPolicy ProxyPolicy } ProxyPolicy ::= SEQUENCE { policyLanguage OBJECT IDENTIFIER, policy OCTET STRING OPTIONAL }
220221222223224225226227228229230
// "Basic Constraints" extension. BasicConstraints bc = new BasicConstraints(false); set.addObject(bc); // "ProxyCertInfo" extension. SOTProxyPolicy pp = new SOTProxyPolicy( new DERObjectIdentifier("1.3.6.1.5.5.7.21.1")); SOTProxyCertInfo pci = new SOTProxyCertInfo(pp); set.addObject(pci); }
56575859606162636465666768
throw new IllegalArgumentException("unknown object in factory"); } public SOTProxyCertInfo(ASN1Sequence seq) { if (seq.size() == 1) { this.proxyPolicy = new SOTProxyPolicy( (ASN1Sequence) seq.getObjectAt(0)); } else if (seq.size() > 1) { this.pCPathLenConstraint = (DERInteger) seq.getObjectAt(0); this.proxyPolicy = new SOTProxyPolicy( (ASN1Sequence) seq.getObjectAt(1)); } }
116117118119120121122123124
subHash = digest[0] + (digest[1] + (digest[2] + (digest[3] >>> 1) * 256) * 256) * 256; return Integer.toString(Math.abs(subHash)); } private void addProxyCertInfoExtension() { SOTProxyPolicy policy = new SOTProxyPolicy(SOTProxyPolicy.INHERITALL); SOTProxyCertInfo proxyCertInfo = new SOTProxyCertInfo(policy); generator.addExtension("1.3.6.1.5.5.7.1.14", CRITICAL, proxyCertInfo); }