Codota Logo
IkePhase1Key.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.batfish.datamodel.IkePhase1Key
constructor

Best Java code snippets using org.batfish.datamodel.IkePhase1Key.<init> (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: batfish/batfish

@Nonnull
private static IkePhase1Key toIkePhase1PreSharedKey(
  IpsecTunnel ipsecTunnel, Ip remoteIdentity, String localInterface) {
 IkePhase1Key ikePhase1Key = new IkePhase1Key();
 ikePhase1Key.setKeyType(IkeKeyType.PRE_SHARED_KEY);
 ikePhase1Key.setKeyHash(ipsecTunnel.getIkePreSharedKeyHash());
 ikePhase1Key.setRemoteIdentity(remoteIdentity.toIpSpace());
 ikePhase1Key.setLocalInterface(localInterface);
 return ikePhase1Key;
}
origin: batfish/batfish

/**
 * Converts {@link IkePolicy} to {@link IkePhase1Policy} and puts the used pre-shared key as a
 * {@link IkePhase1Key} in the passed-in {@code ikePhase1Keys}
 */
private static IkePhase1Policy toIkePhase1Policy(
  IkePolicy ikePolicy, ImmutableSortedMap.Builder<String, IkePhase1Key> ikePhase1Keys) {
 String name = ikePolicy.getName();
 IkePhase1Policy ikePhase1Policy = new IkePhase1Policy(name);
 // pre-shared-key
 IkePhase1Key ikePhase1Key = new IkePhase1Key();
 ikePhase1Key.setKeyType(IkeKeyType.PRE_SHARED_KEY);
 ikePhase1Key.setKeyHash(ikePolicy.getPreSharedKeyHash());
 ikePhase1Keys.put(String.format("~IKE_PHASE1_KEY_%s~", ikePolicy.getName()), ikePhase1Key);
 ikePhase1Policy.setIkePhase1Key(ikePhase1Key);
 ImmutableList.Builder<String> ikePhase1ProposalBuilder = ImmutableList.builder();
 // ike proposals
 ikePolicy.getProposals().forEach(ikePhase1ProposalBuilder::add);
 ikePhase1Policy.setIkePhase1Proposals(ikePhase1ProposalBuilder.build());
 return ikePhase1Policy;
}
origin: batfish/batfish

static IkePhase1Key toIkePhase1Key(Keyring keyring) {
 IkePhase1Key ikePhase1Key = new IkePhase1Key();
 ikePhase1Key.setKeyHash(keyring.getKey());
 ikePhase1Key.setKeyType(IkeKeyType.PRE_SHARED_KEY);
 ikePhase1Key.setLocalInterface(keyring.getLocalInterfaceName());
 if (keyring.getRemoteIdentity() != null) {
  ikePhase1Key.setRemoteIdentity(keyring.getRemoteIdentity().toIpSpace());
 }
 return ikePhase1Key;
}
origin: batfish/batfish

@Test
public void testGenerateRowsIpsec2Fail() {
 // IPSecSession does not have IPSec phase 2 proposal set
 _ipsecSessionBuilder.setNegotiatedIkeP1Proposal(new IkePhase1Proposal("test_ike_proposal"));
 _ipsecSessionBuilder.setNegotiatedIkeP1Key(new IkePhase1Key());
 _graph.putEdgeValue(
   new IpsecPeerConfigId(INITIATOR_IPSEC_PEER_CONFIG, INITIATOR_HOST_NAME),
   new IpsecPeerConfigId(RESPONDER_IPSEC_PEER_CONFIG, RESPONDER_HOST_NAME),
   _ipsecSessionBuilder.build());
 Multiset<IpsecSessionInfo> ipsecSessionInfos =
   rawAnswer(
     _networkConfigurations,
     _graph,
     ImmutableSet.of(INITIATOR_HOST_NAME),
     ImmutableSet.of(RESPONDER_HOST_NAME));
 // answer should have exactly one row
 assertThat(ipsecSessionInfos, hasSize(1));
 assertThat(
   ipsecSessionInfos.iterator().next(), hasIpsecSessionStatus(equalTo(IPSEC_PHASE2_FAILED)));
}
origin: batfish/batfish

@Test
public void testGenerateRowsIpsecEstablished() {
 // IPSecSession has all phases negotiated and IKE phase 1 key consistent
 _ipsecSessionBuilder.setNegotiatedIkeP1Proposal(new IkePhase1Proposal("test_ike_proposal"));
 _ipsecSessionBuilder.setNegotiatedIkeP1Key(new IkePhase1Key());
 _ipsecSessionBuilder.setNegotiatedIpsecP2Proposal(new IpsecPhase2Proposal());
 _graph.putEdgeValue(
   new IpsecPeerConfigId(INITIATOR_IPSEC_PEER_CONFIG, INITIATOR_HOST_NAME),
   new IpsecPeerConfigId(RESPONDER_IPSEC_PEER_CONFIG, RESPONDER_HOST_NAME),
   _ipsecSessionBuilder.build());
 Multiset<IpsecSessionInfo> ipsecSessionInfos =
   rawAnswer(
     _networkConfigurations,
     _graph,
     ImmutableSet.of(INITIATOR_HOST_NAME),
     ImmutableSet.of(RESPONDER_HOST_NAME));
 // answer should have exactly one row
 assertThat(ipsecSessionInfos, hasSize(1));
 assertThat(
   ipsecSessionInfos.iterator().next(),
   hasIpsecSessionStatus(equalTo(IPSEC_SESSION_ESTABLISHED)));
}
origin: batfish/batfish

IkePhase1Key ikePhase1Key = new IkePhase1Key();
ikePhase1Key.setKeyType(IkeKeyType.PRE_SHARED_KEY);
ikePhase1Key.setKeyHash(ipsecPeer.getAuthenticationPreSharedSecretHash());
origin: batfish/batfish

  ImmutableSortedMap.of(
    communityListName, new CommunityList(communityListName, ImmutableList.of(), true)));
config.setIkePhase1Keys(ImmutableSortedMap.of(ikePhase1KeyName, new IkePhase1Key()));
config.setIkePhase1Policies(
  ImmutableSortedMap.of(ikePhase1PolicyName, new IkePhase1Policy(ikePhase1PolicyName)));
org.batfish.datamodelIkePhase1Key<init>

Popular methods of IkePhase1Key

  • getKeyHash
  • getKeyType
  • getLocalInterface
  • match
    Returns true if this IkePhase1Key can be used with the given localInterface and matchIdentity
  • setKeyHash
  • setKeyType
  • setLocalInterface
  • setRemoteIdentity

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • findViewById (Activity)
  • runOnUiThread (Activity)
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • BoxLayout (javax.swing)
  • JFrame (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now