2 * Copyright (c) 2014 Contextream, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.lispflowmapping.implementation.authentication;
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.control.plane.rev150314.MapNotify;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.control.plane.rev150314.MapRegister;
13 public class LispAuthenticationUtil {
15 public static boolean validate(MapRegister mapRegister, String key) {
17 if (mapRegister.getKeyId() != null) {
18 keyId = mapRegister.getKeyId();
20 ILispAuthentication authentication = LispAuthenticationFactory.getAuthentication(LispKeyIDEnum.valueOf(keyId));
21 return authentication.validate(mapRegister, key);
24 public static byte[] createAuthenticationData(MapNotify mapNotify, String key) {
25 ILispAuthentication authentication = LispAuthenticationFactory.getAuthentication(LispKeyIDEnum.valueOf(mapNotify.getKeyId()));
26 return authentication.getAuthenticationData(mapNotify, key);