EncryptedPrivateKeyInfo ::= SEQUENCE { encryptionAlgorithm AlgorithmIdentifier {{KeyEncryptionAlgorithms}}, encryptedData EncryptedData } EncryptedData ::= OCTET STRING KeyEncryptionAlgorithms ALGORITHM-IDENTIFIER ::= { ... -- For local profiles }
7071727374757677787980
ByteArrayOutputStream out = new ByteArrayOutputStream(); ASN1OutputStream asn1Out = new ASN1OutputStream(out); ASN1Object spnegoOIDASN1 = (ASN1Object) spnegoOid.toASN1Object(); ASN1Object taggedSpnegoASN1 = (ASN1Object) taggedSpnego.toASN1Object(); int length = spnegoOIDASN1.getDEREncoded().length + taggedSpnegoASN1.getDEREncoded().length; byte [] lenBytes = writeLength(length); byte[] appWrap = new byte[lenBytes.length + 1];
8384858687888990919293
appWrap[i] = lenBytes[i-1]; } asn1Out.write(appWrap); asn1Out.writeObject(spnegoOid.toASN1Object()); asn1Out.writeObject(taggedSpnego.toASN1Object()); byte[] app = out.toByteArray(); ASN1InputStream in = new ASN1InputStream(app); if( LOG.isDebugEnabled() ){
7273747576777879808182
8586878889909192939495
appWrap[i] = lenBytes[i-1]; } asn1Out.write(appWrap); asn1Out.writeObject(spnegoOid.toASN1Object()); asn1Out.writeObject(taggedSpnego.toASN1Object()); byte[] app = out.toByteArray(); ASN1InputStream in = new ASN1InputStream(app); if (log.isDebugEnabled() ){
177178179180181182183184185186187
EncryptedPrivateKeyInfo encInfo = EncryptedPrivateKeyInfo.getInstance((ASN1Sequence)b.getBagValue()); encInfo = new EncryptedPrivateKeyInfo(encInfo.getEncryptionAlgorithm(), encInfo.getEncryptedData()); b = new SafeBag(PKCSObjectIdentifiers.pkcs8ShroudedKeyBag, encInfo.toASN1Object(), b.getBagAttributes()); ByteArrayOutputStream abOut = new ByteArrayOutputStream(); ASN1OutputStream berOut = new ASN1OutputStream(abOut); berOut.writeObject(new DERSequence(b));
243244245246247248249250251252253
ocspIdentifier.setProducedAt(cal); ResponderIDType responderId = ocspIdentifier.addNewResponderID(); RespID respId = basicOcspResp.getResponderId(); ResponderID ocspResponderId = respId.toASN1Object(); DERTaggedObject derTaggedObject = (DERTaggedObject)ocspResponderId.toASN1Primitive(); if (2 == derTaggedObject.getTagNo()) { ASN1OctetString keyHashOctetString = (ASN1OctetString)derTaggedObject.getObject(); byte key[] = keyHashOctetString.getOctets(); responderId.setByKey(key);
292293294295296297298299300301302
return ret; } } final RespID id = brep.getResponderId(); final DERTaggedObject to = (DERTaggedObject)id.toASN1Object().toASN1Object(); final RespID respId; final X509Certificate[] chain = brep.getCerts("BC"); final PublicKey signerPub = chain[0].getPublicKey(); if (to.getTagNo() == 1) { // This is Name