summaryrefslogtreecommitdiff
path: root/bcprov/src/main/java/org/bouncycastle/its/asn1/SymmAlgorithm.java
blob: 782610e97b0e4769a72c6de452ad8bdbd3d308ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package org.bouncycastle.its.asn1;

import org.bouncycastle.asn1.ASN1Enumerated;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;

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

    private SymmAlgorithm(ASN1Enumerated symmAlgorithm)
    {
        this.symmAlgorithm = symmAlgorithm;
    }

    public SymmAlgorithm(int ordinal)
    {
        this.symmAlgorithm = new ASN1Enumerated(ordinal);
    }

    public SymmAlgorithm getInstance(Object src)
    {
        if (src == null)
        {
            return null;
        }
        else if (src instanceof SymmAlgorithm)
        {
            return (SymmAlgorithm)src;
        }
        else
        {
            return new SymmAlgorithm(ASN1Enumerated.getInstance(src));
        }
    }

    public ASN1Enumerated getSymmAlgorithm()
    {
        return symmAlgorithm;
    }

    public void setSymmAlgorithm(ASN1Enumerated symmAlgorithm)
    {
        this.symmAlgorithm = symmAlgorithm;
    }

    public ASN1Primitive toASN1Primitive()
    {
        return symmAlgorithm.toASN1Primitive();
    }
}