Package com.sun.jna.platform.win32.Sspi

Examples of com.sun.jna.platform.win32.Sspi.TimeStamp


    }
   
    public void testAcceptSecurityContext() {
      // client ----------- acquire outbound credential handle
      CredHandle phClientCredential = new CredHandle();
      TimeStamp ptsClientExpiry = new TimeStamp();
      assertEquals(W32Errors.SEC_E_OK, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "Negotiate", Sspi.SECPKG_CRED_OUTBOUND, null, null, null,
          null, phClientCredential, ptsClientExpiry));
      // client ----------- security context
      CtxtHandle phClientContext = new CtxtHandle();
      IntByReference pfClientContextAttr = new IntByReference();
    // server ----------- acquire inbound credential handle
      CredHandle phServerCredential = new CredHandle();
      TimeStamp ptsServerExpiry = new TimeStamp();
      assertEquals(W32Errors.SEC_E_OK, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "Negotiate", Sspi.SECPKG_CRED_INBOUND, null, null, null,
          null, phServerCredential, ptsServerExpiry));
      // server ----------- security context
    CtxtHandle phServerContext = new CtxtHandle();
View Full Code Here


    }
   
    public void testImpersonateRevertSecurityContext() {
      // client ----------- acquire outbound credential handle
      CredHandle phClientCredential = new CredHandle();
      TimeStamp ptsClientExpiry = new TimeStamp();
      assertEquals(W32Errors.SEC_E_OK, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "Negotiate", Sspi.SECPKG_CRED_OUTBOUND, null, null, null,
          null, phClientCredential, ptsClientExpiry));
      // client ----------- security context
      CtxtHandle phClientContext = new CtxtHandle();
      IntByReference pfClientContextAttr = new IntByReference();
    // server ----------- acquire inbound credential handle
      CredHandle phServerCredential = new CredHandle();
      TimeStamp ptsServerExpiry = new TimeStamp();
      assertEquals(W32Errors.SEC_E_OK, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "Negotiate", Sspi.SECPKG_CRED_INBOUND, null, null, null,
          null, phServerCredential, ptsServerExpiry));
      // server ----------- security context
    CtxtHandle phServerContext = new CtxtHandle();
View Full Code Here

    }
   
    public void testQuerySecurityContextToken() {
      // client ----------- acquire outbound credential handle
      CredHandle phClientCredential = new CredHandle();
      TimeStamp ptsClientExpiry = new TimeStamp();
      assertEquals(W32Errors.SEC_E_OK, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "Negotiate", Sspi.SECPKG_CRED_OUTBOUND, null, null, null,
          null, phClientCredential, ptsClientExpiry));
      // client ----------- security context
      CtxtHandle phClientContext = new CtxtHandle();
      IntByReference pfClientContextAttr = new IntByReference();
    // server ----------- acquire inbound credential handle
      CredHandle phServerCredential = new CredHandle();
      TimeStamp ptsServerExpiry = new TimeStamp();
      assertEquals(W32Errors.SEC_E_OK, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "Negotiate", Sspi.SECPKG_CRED_INBOUND, null, null, null,
          null, phServerCredential, ptsServerExpiry));
      // server ----------- security context
    CtxtHandle phServerContext = new CtxtHandle();
View Full Code Here

            }

            // client credentials handle
            try {
                final String username = CurrentWindowsCredentials.getCurrentUsername();
                final TimeStamp lifetime = new TimeStamp();

                clientCred = new CredHandle();
                final int rc = Secur32.INSTANCE.AcquireCredentialsHandle(username,
                        scheme, Sspi.SECPKG_CRED_OUTBOUND, null, null, null, null,
                        clientCred, lifetime);
View Full Code Here

            }

            // client credentials handle
            try {
                final String username = CurrentWindowsCredentials.getCurrentUsername();
                final TimeStamp lifetime = new TimeStamp();

                clientCred = new CredHandle();
                final int rc = Secur32.INSTANCE.AcquireCredentialsHandle(username,
                        scheme, Sspi.SECPKG_CRED_OUTBOUND, null, null, null, null,
                        clientCred, lifetime);
View Full Code Here

            }

            // client credentials handle
            try {
                final String username = CurrentWindowsCredentials.getCurrentUsername();
                final TimeStamp lifetime = new TimeStamp();

                clientCred = new CredHandle();
                final int rc = Secur32.INSTANCE.AcquireCredentialsHandle(username,
                        scheme, Sspi.SECPKG_CRED_OUTBOUND, null, null, null, null,
                        clientCred, lifetime);
View Full Code Here

      assertTrue(username.length() > 0);
    }
   
    public void testAcquireCredentialsHandle() {
      CredHandle phCredential = new CredHandle();
      TimeStamp ptsExpiry = new TimeStamp();
      assertEquals(W32Errors.SEC_E_OK, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "Negotiate", new NativeLong(Sspi.SECPKG_CRED_OUTBOUND), null, null, null,
          null, phCredential, ptsExpiry));
      assertTrue(phCredential.dwLower != null);
      assertTrue(phCredential.dwUpper != null);
View Full Code Here

          phCredential));     
    }
   
    public void testAcquireCredentialsHandleInvalidPackage() {
      CredHandle phCredential = new CredHandle();
      TimeStamp ptsExpiry = new TimeStamp();
      assertEquals(W32Errors.SEC_E_SECPKG_NOT_FOUND, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "PackageDoesntExist", new NativeLong(Sspi.SECPKG_CRED_OUTBOUND), null, null, null,
          null, phCredential, ptsExpiry));
    }
View Full Code Here

          null, phCredential, ptsExpiry));
    }
   
    public void testInitializeSecurityContext() {
      CredHandle phCredential = new CredHandle();
      TimeStamp ptsExpiry = new TimeStamp();
      // acquire a credentials handle
      assertEquals(W32Errors.SEC_E_OK, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "Negotiate", new NativeLong(Sspi.SECPKG_CRED_OUTBOUND), null, null, null,
          null, phCredential, ptsExpiry));
      // initialize security context
View Full Code Here

    }
   
    public void testAcceptSecurityContext() {
      // client ----------- acquire outbound credential handle
      CredHandle phClientCredential = new CredHandle();
      TimeStamp ptsClientExpiry = new TimeStamp();
      assertEquals(W32Errors.SEC_E_OK, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "Negotiate", new NativeLong(Sspi.SECPKG_CRED_OUTBOUND), null, null, null,
          null, phClientCredential, ptsClientExpiry));
      // client ----------- security context
      CtxtHandle phClientContext = new CtxtHandle();
      NativeLongByReference pfClientContextAttr = new NativeLongByReference();
    // server ----------- acquire inbound credential handle
      CredHandle phServerCredential = new CredHandle();
      TimeStamp ptsServerExpiry = new TimeStamp();
      assertEquals(W32Errors.SEC_E_OK, Secur32.INSTANCE.AcquireCredentialsHandle(
          null, "Negotiate", new NativeLong(Sspi.SECPKG_CRED_INBOUND), null, null, null,
          null, phServerCredential, ptsServerExpiry));
      // server ----------- security context
    CtxtHandle phServerContext = new CtxtHandle();
View Full Code Here

TOP

Related Classes of com.sun.jna.platform.win32.Sspi.TimeStamp

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.