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

package org.bouncycastle.oer.its.ieee1609dot2;

import org.bouncycastle.asn1.DERTaggedObject;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1Choice;
import org.bouncycastle.asn1.ASN1Object;

public class SymmetricCiphertext extends ASN1Object implements ASN1Choice
{
    public static final int aes128ccm = 0;
    private final int choice;
    private final ASN1Encodable symmetricCiphertext;
    
    public SymmetricCiphertext(final int choice, final ASN1Encodable symmetricCiphertext) {
        this.choice = choice;
        this.symmetricCiphertext = symmetricCiphertext;
    }
    
    private SymmetricCiphertext(final ASN1TaggedObject asn1TaggedObject) {
        switch (this.choice = asn1TaggedObject.getTagNo()) {
            case 0: {
                this.symmetricCiphertext = AesCcmCiphertext.getInstance(asn1TaggedObject.getExplicitBaseObject());
                return;
            }
            default: {
                throw new IllegalArgumentException("invalid choice value " + this.choice);
            }
        }
    }
    
    public static SymmetricCiphertext aes128ccm(final AesCcmCiphertext aesCcmCiphertext) {
        return new SymmetricCiphertext(0, aesCcmCiphertext);
    }
    
    public static SymmetricCiphertext getInstance(final Object o) {
        if (o instanceof SymmetricCiphertext) {
            return (SymmetricCiphertext)o;
        }
        if (o != null) {
            return new SymmetricCiphertext(ASN1TaggedObject.getInstance(o, 128));
        }
        return null;
    }
    
    public int getChoice() {
        return this.choice;
    }
    
    public ASN1Encodable getSymmetricCiphertext() {
        return this.symmetricCiphertext;
    }
    
    @Override
    public ASN1Primitive toASN1Primitive() {
        return new DERTaggedObject(this.choice, this.symmetricCiphertext);
    }
}
