Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for getSessionKey (0.11 sec)

  1. src/test/java/jcifs/dcerpc/DcerpcPipeHandleTest.java

                DcerpcPipeHandle handle = createMockedDcerpcPipeHandle();
                byte[] expectedKey = "sessionKey".getBytes();
                when(mockSmbPipeHandleInternal.getSessionKey()).thenReturn(expectedKey);
                assertArrayEquals(expectedKey, handle.getSessionKey());
            }
    
            @Test
            @DisplayName("Should propagate CIFSException when getting session key")
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 21K bytes
    - Viewed (0)
  2. src/main/java/jcifs/smb/SmbPipeHandleImpl.java

        /**
         *
         * {@inheritDoc}
         *
         * @see jcifs.smb.SmbPipeHandleInternal#getSessionKey()
         */
        @Override
        public byte[] getSessionKey() throws CIFSException {
            try (SmbTreeHandleImpl th = ensureTreeConnected(); SmbSessionImpl sess = th.getSession()) {
                return sess.getSessionKey();
            }
        }
    
        /**
         * {@inheritDoc}
         *
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 10.2K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb/SmbSessionImplTest.java

            assertTrue(session.isInUse());
        }
    
        @Test
        @DisplayName("getSessionKey: throws when absent, returns when present")
        void testGetSessionKey() throws Exception {
            SmbSessionImpl session = newSession();
    
            // Absent key -> CIFSException
            CIFSException noKey = assertThrows(CIFSException.class, session::getSessionKey);
            assertTrue(noKey.getMessage().contains("No session key"));
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 12.5K bytes
    - Viewed (0)
  4. src/test/java/jcifs/smb/SmbPipeHandleImplTest.java

        }
    
        @Test
        @DisplayName("getSessionKey fetches via tree->session and returns bytes")
        void testGetSessionKey() throws CIFSException {
            when(pipe.ensureTreeConnected()).thenReturn(tree);
            when(tree.acquire()).thenReturn(tree);
            SmbSessionImpl session = mock(SmbSessionImpl.class);
            when(tree.getSession()).thenReturn(session);
            when(session.getSessionKey()).thenReturn(new byte[] { 1, 2, 3 });
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 11.7K bytes
    - Viewed (0)
  5. src/test/java/jcifs/dcerpc/DcerpcHandleTest.java

                return serverWithDfs;
            }
    
            @Override
            public CIFSContext getTransportContext() {
                return localTransportContext;
            }
    
            @Override
            public byte[] getSessionKey() throws CIFSException {
                return sessionKey;
            }
    
            @Override
            protected void doSendFragment(byte[] buf, int off, int length) throws IOException {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 15.3K bytes
    - Viewed (0)
  6. src/main/java/jcifs/smb1/ntlmssp/Type3Message.java

            return masterKey;
        }
    
        /**
         * Returns the session key.
         *
         * @return A <code>byte[]</code> containing the session key.
         */
        public byte[] getSessionKey() {
            return sessionKey;
        }
    
        /**
         * Sets the session key.
         *
         * @param sessionKey The session key.
         */
        public void setSessionKey(final byte[] sessionKey) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 24.1K bytes
    - Viewed (0)
  7. src/test/java/jcifs/util/SecureKeyManagerTest.java

        }
    
        @Test
        public void testStoreAndRetrieveKey() {
            String sessionId = "test-session-1";
            keyManager.storeSessionKey(sessionId, testKey, "AES");
    
            SecretKey retrieved = keyManager.getSessionKey(sessionId);
            assertNotNull(retrieved, "Should retrieve stored key");
            assertArrayEquals(testKey, retrieved.getEncoded(), "Retrieved key should match");
        }
    
        @Test
        public void testGetRawKey() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 14.2K bytes
    - Viewed (0)
  8. src/test/java/jcifs/smb/SmbPipeHandleInternalTest.java

            // After close, report stale
            handle.close();
            assertTrue(handle.isStale(), "Closed handle reports stale");
        }
    
        @Test
        @DisplayName("getSessionKey propagates CIFSException from session acquisition")
        void getSessionKey_exception_propagates() throws Exception {
            SmbPipeHandleImpl handle = newHandleWithBasicStubs(0, "\\\\pipe\\\\sess");
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 16.7K bytes
    - Viewed (0)
  9. src/main/java/jcifs/internal/smb2/multichannel/ChannelManager.java

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
    
            try {
                // Combine session key with channel-specific data
                byte[] sessionKey = getSessionKey();
                if (sessionKey != null) {
                    baos.write(sessionKey);
                }
                baos.write(channel.getLocalInterface().getAddress().getAddress());
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 21 11:13:46 UTC 2025
    - 20K bytes
    - Viewed (0)
  10. src/main/java/jcifs/util/SecureKeyManager.java

        }
    
        /**
         * Retrieve a session key
         *
         * @param sessionId unique session identifier
         * @return the secret key, or null if not found
         */
        public SecretKey getSessionKey(String sessionId) {
            checkNotClosed();
    
            SecretKey key = sessionKeys.get(sessionId);
    
            // Try to load from KeyStore if not in memory
            if (key == null && keyStore != null) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 21.5K bytes
    - Viewed (0)
Back to top