All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bouncycastle.oer.its.RectangularRegion Maven / Gradle / Ivy

Go to download

The Bouncy Castle Java APIs for ASN.1 extension and utility APIs used to support bcpkix and bctls. This jar contains APIs for JDK 1.5 and up.

The newest version!
package org.bouncycastle.oer.its;

import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERSequence;

/**
 * 
 *     RectangularRegion ::= SEQUENCE {
 *         northWest TwoDLocation,
 *         southEast TwoDLocation
 *     }
 * 
*/ public class RectangularRegion extends ASN1Object implements RegionInterface { private final TwoDLocation northWest; private final TwoDLocation southEast; public RectangularRegion(TwoDLocation northWest, TwoDLocation southEast) { this.northWest = northWest; this.southEast = southEast; } public static RectangularRegion getInstance(Object o) { if (o instanceof RectangularRegion) { return (RectangularRegion)o; } else { ASN1Sequence seg = ASN1Sequence.getInstance(o); return new RectangularRegion(TwoDLocation.getInstance(seg.getObjectAt(0)), TwoDLocation.getInstance(seg.getObjectAt(1))); } } public TwoDLocation getNorthWest() { return northWest; } public TwoDLocation getSouthEast() { return southEast; } public ASN1Primitive toASN1Primitive() { return new DERSequence(new ASN1Encodable[]{northWest, southEast}); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy