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

org.bouncycastle.oer.its.SymmAlgorithm 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 java.math.BigInteger;

import org.bouncycastle.asn1.ASN1Enumerated;

public class SymmAlgorithm
    extends ASN1Enumerated
{
    public static SymmAlgorithm aes128Ccm = new SymmAlgorithm(0);

    public SymmAlgorithm(int ordinal)
    {
        super(ordinal);

        if (ordinal != 0)
        {
            throw new IllegalArgumentException("ordinal can only be zero");
        }
    }

    public static SymmAlgorithm getInstance(Object src)
    {
        if (src == null)
        {
            return null;
        }
        else if (src instanceof SymmAlgorithm)
        {
            return (SymmAlgorithm)src;
        }
        else
        {
            BigInteger bi = ASN1Enumerated.getInstance(src).getValue();
            switch (bi.intValue())
            {
            case 0:
                return aes128Ccm;
            default:
                throw new IllegalArgumentException("unaccounted enum value " + bi);
            }
        }

    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy