Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 32 for PACDecodingException (0.09 sec)

  1. src/main/java/jcifs/pac/PACDecodingException.java

     * Indicates malformed or invalid PAC structures in Kerberos tickets.
     */
    public class PACDecodingException extends CIFSException {
    
        private static final long serialVersionUID = 1L;
    
        /**
         * Constructs a new PAC decoding exception with no detail message.
         */
        public PACDecodingException() {
            this(null, null);
        }
    
        /**
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 2K bytes
    - Viewed (0)
  2. src/test/java/jcifs/pac/kerberos/KerberosAuthDataTest.java

         * Expects a {@link PACDecodingException} to be thrown.
         */
        @Test
        void testParseAuthDataPacWithInvalidToken() {
            // GIVEN an invalid token for AUTH_DATA_PAC
            byte[] invalidToken = "invalid-pac-token".getBytes();
    
            // WHEN parsing the auth data
            // THEN a PACDecodingException should be thrown
            assertThrows(PACDecodingException.class, () -> {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 2.7K bytes
    - Viewed (0)
  3. src/main/java/jcifs/pac/kerberos/KerberosToken.java

            this(token, null);
        }
    
        /**
         * Constructs a KerberosToken from token bytes with decryption keys.
         *
         * @param token the token bytes
         * @param keys array of Kerberos keys for decryption
         * @throws PACDecodingException if token decoding fails
         */
        public KerberosToken(byte[] token, KerberosKey[] keys) throws PACDecodingException {
    
            if (token.length <= 0) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 3.8K bytes
    - Viewed (0)
  4. src/test/java/jcifs/pac/kerberos/KerberosPacAuthDataTest.java

            byte[] emptyToken = new byte[0];
            PACDecodingException e = assertThrows(PACDecodingException.class, () -> {
                new KerberosPacAuthData(emptyToken, keys);
            });
            assertTrue(e.getMessage().contains("PAC"));
        }
    
        // Test exception for short PAC
        @Test
        void testConstructorShortPac() {
            byte[] shortToken = new byte[7];
            PACDecodingException e = assertThrows(PACDecodingException.class, () -> {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 6.3K bytes
    - Viewed (0)
  5. src/test/java/jcifs/pac/PacTest.java

        }
    
        @Test
        void testEmptyPac() {
            // Test that PAC with size <= 8 is rejected
            byte[] emptyData = new byte[8];
    
            PACDecodingException e = assertThrows(PACDecodingException.class, () -> new Pac(emptyData, keys));
            // Any PACDecodingException is acceptable for this test
            assertNotNull(e.getMessage());
        }
    
        @Test
        void testTooSmallPac() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.9K bytes
    - Viewed (0)
  6. src/test/java/jcifs/pac/PACDecodingExceptionTest.java

    import org.junit.jupiter.api.Test;
    
    /**
     * Tests for the PACDecodingException class.
     */
    class PACDecodingExceptionTest {
    
        /**
         * Test the default constructor.
         */
        @Test
        void testDefaultConstructor() {
            PACDecodingException e = new PACDecodingException();
            // Expect null message and null cause
            assertNull(e.getMessage());
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 2K bytes
    - Viewed (0)
  7. src/test/java/jcifs/pac/PacUnicodeStringTest.java

            String testString = "not-null";
    
            // Expect a PACDecodingException to be thrown
            PACDecodingException exception = assertThrows(PACDecodingException.class, () -> {
                pacString.check(testString);
            }, "A PACDecodingException should be thrown for a non-empty string with a zero pointer.");
    
            // Verify the exception message
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.7K bytes
    - Viewed (0)
  8. src/test/java/jcifs/pac/kerberos/KerberosRelevantAuthDataTest.java

            // The exception could be PACDecodingException or NullPointerException
            assertTrue(exception instanceof PACDecodingException || exception instanceof NullPointerException,
                    "The exception should be either PACDecodingException or NullPointerException.");
    
            if (exception instanceof PACDecodingException) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 9K bytes
    - Viewed (0)
  9. src/main/java/jcifs/pac/kerberos/KerberosApRequest.java

         * @throws PACDecodingException if the token cannot be decoded
         */
        public KerberosApRequest(byte[] token, KerberosKey[] keys) throws PACDecodingException {
            this(parseSequence(token), keys);
        }
    
        private static ASN1Sequence parseSequence(byte[] token) throws PACDecodingException {
            if (token.length <= 0) {
                throw new PACDecodingException("Empty kerberos ApReq");
            }
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 4.9K bytes
    - Viewed (0)
  10. src/test/java/jcifs/pac/ASN1UtilTest.java

            // Test failed casting
            Object obj = 123; // Integer
            assertThrows(PACDecodingException.class, () -> {
                ASN1Util.as(String.class, obj);
            }, "Should throw PACDecodingException for incompatible types");
        }
    
        // --- as(Class, Enumeration) ---
    
        @Test
        void testAs_Enumeration_Success() throws PACDecodingException {
            // Test successful casting from enumeration
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 9.4K bytes
    - Viewed (0)
Back to top