public RevocationDetails Build() { return(new RevocationDetails(new RevDetails(_templateBuilder.Build()))); }
public CertificateRequestMessage Build() { Asn1EncodableVector v = new Asn1EncodableVector(); v.Add(new DerInteger(this._certReqId)); if (!this._extGenerator.IsEmpty) { this._templateBuilder.SetExtensions(_extGenerator.Generate()); } v.Add(_templateBuilder.Build()); if (_controls.Count > 0) { Asn1EncodableVector controlV = new Asn1EncodableVector(); foreach (Object item in _controls) { IControl control = (IControl)item; controlV.Add(new AttributeTypeAndValue(control.Type, control.Value)); } v.Add(new DerSequence(controlV)); } CertRequest request = CertRequest.GetInstance(new DerSequence(v)); v = new Asn1EncodableVector(); v.Add(request); if (_popSigner != null) { CertTemplate template = request.CertTemplate; if (template.Subject == null || template.PublicKey == null) { SubjectPublicKeyInfo pubKeyInfo = request.CertTemplate.PublicKey; ProofOfPossessionSigningKeyBuilder builder = new ProofOfPossessionSigningKeyBuilder(pubKeyInfo); if (_sender != null) { builder.setSender(_sender); } else { // PkMa pkmacGenerator = new PKMACValueGenerator(_pkmacBuilder); builder.setPublicKeyMac(_pkMacBuilder, _password); } v.Add(new ProofOfPossession(builder.build(_popSigner))); } else { ProofOfPossessionSigningKeyBuilder builder = new ProofOfPossessionSigningKeyBuilder(request); v.Add(new ProofOfPossession(builder.build(_popSigner))); } } else if (_popoPrivKey != null) { v.Add(new ProofOfPossession(_popoType, _popoPrivKey)); } else if (_agreeMac != null) { v.Add(new ProofOfPossession(ProofOfPossession.TYPE_KEY_AGREEMENT, PopoPrivKey.GetInstance(new DerTaggedObject(false, PopoPrivKey.agreeMAC, _agreeMac), true))); } else if (_popRaVerified != null) { v.Add(new ProofOfPossession()); } return(new CertificateRequestMessage(CertReqMsg.GetInstance(new DerSequence(v)))); }