Tabnine Logo
ApRep.getMsgType
Code IndexAdd Tabnine to your IDE (free)

How to use
getMsgType
method
in
org.apache.kerby.kerberos.kerb.type.ap.ApRep

Best Java code snippets using org.apache.kerby.kerberos.kerb.type.ap.ApRep.getMsgType (Showing top 2 results out of 315)

origin: apache/directory-kerby

ApRep apRep = apResponse.getApRep();
assertThat(apRep.getPvno()).isEqualTo(5);
assertThat(apRep.getMsgType()).isEqualTo(KrbMessageType.AP_REP);
origin: com.redhat.red.build/kojiji

public static ApRep readRep( byte[] buf, EncryptionKey key, long allowableClockSkew, ApReq apReq, InetAddress initiator )
    throws KrbException
{
  ApRep apRep = KrbCodec.decode( buf, ApRep.class );
  if ( apRep.getPvno() != KrbConstant.KRB_V5 )
  {
    throw new KrbException( KrbErrorCode.KRB_AP_ERR_BADVERSION );
  }
  if ( !apRep.getMsgType().equals( KrbMessageType.AP_REP ) )
  {
    throw new KrbException( KrbErrorCode.KRB_AP_ERR_MSG_TYPE );
  }
  try {
    ApRequest.validate( key, apReq, initiator, allowableClockSkew * 1000 );
  } catch (KrbException e) {
    // XXX: The checksum verification fails, but we can continue, so just log the error
    logger.debug("Ap Request validation error: code={}, message={}", e.getKrbErrorCode(), e.getMessage(), e );
  }
  EncAPRepPart encRepPart = EncryptionUtil.unseal( apRep.getEncryptedEncPart(), key, KeyUsage.AP_REP_ENCPART, EncAPRepPart.class );
  apRep.setEncRepPart( encRepPart );
  ApRequest.unsealAuthenticator( key, apReq );
  EncAPRepPart encAPRepPart = apRep.getEncRepPart();
  Authenticator authenticator = apReq.getAuthenticator();
  if ( !encAPRepPart.getCtime().equals( authenticator.getCtime() ) || encAPRepPart.getCusec() != authenticator.getCusec() )
  {
    throw new KrbException( KrbErrorCode.KRB_AP_ERR_MODIFIED );
  }
  return apRep;
}
org.apache.kerby.kerberos.kerb.type.apApRepgetMsgType

Popular methods of ApRep

  • <init>
    Creates an instance of ApRep
  • getEncRepPart
  • getEncryptedEncPart
  • getPvno
  • setEncRepPart
    Set the decrypted EncRepPart into the message
  • decode
  • encode
  • encodingLength
  • getFieldAs
  • setEncryptedEncPart
    Set the encrypted part into the message
  • setFieldAs
  • setFieldAs

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Notification (javax.management)
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now