// 
// Decompiled by Procyon v0.6.0
// 

package org.bouncycastle.oer.its.ieee1609dot2.basetypes;

import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.ASN1Primitive;
import java.math.BigInteger;
import org.bouncycastle.asn1.ASN1Object;

public class Psid extends ASN1Object
{
    private final BigInteger psid;
    
    public Psid(final long val) {
        this(BigInteger.valueOf(val));
    }
    
    public Psid(final BigInteger psid) {
        if (psid.signum() < 0) {
            throw new IllegalStateException("psid must be greater than zero");
        }
        this.psid = psid;
    }
    
    public BigInteger getPsid() {
        return this.psid;
    }
    
    @Override
    public ASN1Primitive toASN1Primitive() {
        return new ASN1Integer(this.psid);
    }
    
    public static Psid getInstance(final Object o) {
        if (o instanceof Psid) {
            return (Psid)o;
        }
        if (o != null) {
            return new Psid(ASN1Integer.getInstance(o).getValue());
        }
        return null;
    }
}
