1
2
3
4
5
6
7
8 package org.opendaylight.lispflowmapping.implementation.authentication;
9
10 public enum LispKeyIDEnum {
11 NONE(0, null),
12 SHA1(1, "HmacSHA1"),
13 SHA256(2, "HmacSHA256"),
14 UNKNOWN(-1, null);
15
16 private short keyID;
17 private String authenticationName;
18
19 private LispKeyIDEnum(int keyID, String authenticationName) {
20 this.keyID = (short) keyID;
21 this.authenticationName = authenticationName;
22 }
23
24 public String getAuthenticationName() {
25 return authenticationName;
26 }
27
28 public short getKeyID() {
29 return keyID;
30 }
31
32 public static LispKeyIDEnum valueOf(short keyID) {
33 for (LispKeyIDEnum val : values()) {
34 if (val.getKeyID() == keyID) {
35 return val;
36 }
37 }
38 return UNKNOWN;
39 }
40 }