Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for getPasswordAsCharArray (0.88 sec)

  1. src/main/java/jcifs/smb/NtlmPasswordAuthenticator.java

         * it is supplied by the user at runtime.
         *
         * @return the password
         * @deprecated Use getPasswordAsCharArray() for better security
         */
        @Deprecated
        public String getPassword() {
            checkNotClosed();
            log.warn("getPassword() is deprecated and insecure. Use getPasswordAsCharArray() instead.");
            return this.password != null ? new String(this.password) : null;
        }
    
        /**
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 30.3K bytes
    - Viewed (0)
  2. src/test/java/jcifs/smb/JAASAuthenticatorTest.java

            // Spy to override getPasswordAsCharArray() to return null
            JAASAuthenticator spyAuth = spy(new JAASAuthenticator("DOM", "user", null));
            when(spyAuth.getPasswordAsCharArray()).thenReturn(null);
    
            PasswordCallback pc = new PasswordCallback("pass:", false);
            spyAuth.handle(new Callback[] { pc });
    
            // Since getPasswordAsCharArray() returned null, handler should not set a password
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 9.9K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb/NtlmPasswordAuthenticatorTest.java

            assertNotNull(auth1.getPasswordAsCharArray());
            assertEquals(0, auth1.getPasswordAsCharArray().length);
    
            // Test with empty char[] password
            NtlmPasswordAuthenticator auth2 = new NtlmPasswordAuthenticator("testuser", new char[0]);
            assertEquals("", auth2.getPassword());
            assertNotNull(auth2.getPasswordAsCharArray());
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 23.3K bytes
    - Viewed (0)
  4. src/test/java/jcifs/smb/NtlmPasswordAuthenticatorSecurityTest.java

            char[] password = authenticator.getPasswordAsCharArray();
            assertNotNull(password, "Password char array should not be null");
            assertArrayEquals(testPassword.toCharArray(), password, "Password should match");
    
            // Verify it returns a clone, not the original
            password[0] = 'X';
            char[] password2 = authenticator.getPasswordAsCharArray();
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 8.5K bytes
    - Viewed (0)
  5. src/main/java/jcifs/smb/NtlmContext.java

            String passwordString = null;
            if (this.auth.isGuest()) {
                passwordString = this.transportContext.getConfig().getGuestPassword();
            } else {
                char[] passwordChars = this.auth.getPasswordAsCharArray();
                if (passwordChars != null) {
                    passwordString = new String(passwordChars);
                    // Securely wipe the char array immediately after use
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 17.3K bytes
    - Viewed (0)
  6. src/main/java/jcifs/smb/JAASAuthenticator.java

                        nc.setName(this.getUsername() + "@" + userDomain);
                    }
                } else if (cb instanceof PasswordCallback pc) {
                    char[] passwordChars = this.getPasswordAsCharArray();
                    if (passwordChars != null) {
                        pc.setPassword(passwordChars);
                    }
                }
            }
        }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 8.3K bytes
    - Viewed (0)
Back to top