Ejemplo n.º 1
0
 public EnergyData(float energy, bool isValid, BasicConstraintData basicConstraintData, CorridorConstraintData corridorConstraintData, MinimumDistanceConstraintData minimumDistanceConstraintData)
 {
     Energy                        = energy;
     IsValid                       = isValid;
     BasicConstraintData           = basicConstraintData;
     CorridorConstraintData        = corridorConstraintData;
     MinimumDistanceConstraintData = minimumDistanceConstraintData;
 }
Ejemplo n.º 2
0
        public X509Certificate SetBasicConstraint(BasicConstraintData data)
        {
            var seq = new Asn1Sequence {
                Nodes = { new Asn1Boolean(data.Authority) }
            };

            if (data.PathLengthConstraint.HasValue)
            {
                seq.Nodes.Add(new Asn1Integer(data.PathLengthConstraint.Value));
            }
            Tbs.Extensions.Add(new X509Extension {
                Id       = Asn1ObjectIdentifier.BasicConstraints,
                Critical = true,
                Value    = seq.GetBytes()
            });

            return(this);
        }