Esempio n. 1
0
 /**
  * Constructor from a given details.
  *
  * According RFC 3280, the minimum and maximum fields are not used with any
  * name forms, thus minimum MUST be zero, and maximum MUST be absent.
  * <p>
  * If minimum is <code>null</code>, zero is assumed, if
  * maximum is <code>null</code>, maximum is absent.</p>
  *
  * @param baseName
  *            A restriction.
  * @param minimum
  *            Minimum
  *
  * @param maximum
  *            Maximum
  */
 public GeneralSubtree(
     GeneralName baseName,
     BigInteger minimum,
     BigInteger maximum)
 {
     this.baseName = baseName;
     if (minimum != null)
     {
         this.minimum = new DerInteger(minimum);
     }
     if (maximum != null)
     {
         this.maximum = new DerInteger(maximum);
     }
 }
Esempio n. 2
0
        /**
         * Constructor.
         * @param roleAuthority the role authority of this RoleSyntax.
         * @param roleName    the role name of this RoleSyntax.
         */
        public RoleSyntax(
            GeneralNames roleAuthority,
            GeneralName roleName)
        {
            if (roleName == null ||
                roleName.TagNo != GeneralName.UniformResourceIdentifier ||
                ((IAsn1String)roleName.Name).GetString().Equals(""))
            {
                throw new ArgumentException("the role name MUST be non empty and MUST " +
                                            "use the URI option of GeneralName");
            }

            this.roleAuthority = roleAuthority;
            this.roleName      = roleName;
        }
Esempio n. 3
0
        /**
         * Constructor from Asn1TaggedObject.
         *
         * @param tagObj The tagged object.
         * @throws ArgumentException if the encoding is wrong.
         */
        private Target(
            Asn1TaggedObject tagObj)
        {
            switch ((Choice)tagObj.TagNo)
            {
            case Choice.Name:                           // GeneralName is already a choice so explicit
                targetName = GeneralName.GetInstance(tagObj, true);
                break;

            case Choice.Group:
                targetGroup = GeneralName.GetInstance(tagObj, true);
                break;

            default:
                throw new ArgumentException("unknown tag: " + tagObj.TagNo);
            }
        }
Esempio n. 4
0
 /**
  * Constructor. Invoking this constructor is the same as invoking
  * <code>new RoleSyntax(null, roleName)</code>.
  * @param roleName    the role name of this RoleSyntax.
  */
 public RoleSyntax(
     GeneralName roleName)
     : this(null, roleName)
 {
 }
Esempio n. 5
0
 /**
  * Constructor from given details.
  * <p>
  * Exactly one of the parameters must be not <code>null</code>.</p>
  *
  * @param type the choice type to apply to the name.
  * @param name the general name.
  * @throws ArgumentException if type is invalid.
  */
 public Target(
     Choice type,
     GeneralName name)
     : this(new DerTaggedObject((int)type, name))
 {
 }
Esempio n. 6
0
 public GeneralSubtree(
     GeneralName baseName)
     : this(baseName, null, null)
 {
 }
 /**
  * create an AuthorityInformationAccess with the oid and location provided.
  */
 public AuthorityInformationAccess(DerObjectIdentifier oid, GeneralName location)
     : this(new AccessDescription(oid, location))
 {
 }
Esempio n. 8
0
 /// <summary>Construct a GeneralNames object containing one GeneralName.</summary>
 /// <param name="name">The name to be contained.</param>
 public GeneralNames(
     GeneralName name)
 {
     names = new GeneralName[] { name };
 }