Class NSURLCredential

  • All Implemented Interfaces:
    NSCoding, NSCopying, NSSecureCoding, NSObject

    public class NSURLCredential
    extends NSObject
    implements NSSecureCoding, NSCopying
    NSURLCredential This class is an immutable object representing an authentication credential. The actual type of the credential is determined by the constructor called in the categories declared below.
    • Constructor Detail

      • NSURLCredential

        protected NSURLCredential​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • credentialForTrust

        public static NSURLCredential credentialForTrust​(SecTrustRef trust)
        credentialForTrust: Create a new NSURLCredential which specifies that a handshake has been trusted.
        Returns:
        The new autoreleased NSURLCredential
      • credentialWithIdentityCertificatesPersistence

        public static NSURLCredential credentialWithIdentityCertificatesPersistence​(SecIdentityRef identity,
                                                                                    NSArray<?> certArray,
                                                                                    long persistence)
        credentialWithIdentity:certificates:persistence: Create a new NSURLCredential with an identity and certificate array
        Parameters:
        identity - a SecIdentityRef object
        certArray - an array containing at least one SecCertificateRef objects
        persistence - enum that says to store per session, permanently or not at all
        Returns:
        The new autoreleased NSURLCredential
      • credentialWithUserPasswordPersistence

        public static NSURLCredential credentialWithUserPasswordPersistence​(java.lang.String user,
                                                                            java.lang.String password,
                                                                            long persistence)
        credentialWithUser:password:persistence: Create a new NSURLCredential with a user and password
        Parameters:
        user - the username
        password - the password
        persistence - enum that says to store per session, permanently or not at all
        Returns:
        The new autoreleased NSURLCredential
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • version_static

        public static long version_static()
      • certificates

        public NSArray<?> certificates()
        Returns an NSArray of SecCertificateRef objects representing the client certificate for this credential, if this credential was created with an identity and certificate.
        Returns:
        an NSArray of SecCertificateRef or NULL if this is a username/password credential
      • copyWithZone

        public java.lang.Object copyWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • hasPassword

        public boolean hasPassword()
        Find out if this credential has a password, without trying to get it If this credential's password is actually kept in an external store, the password method may return nil even if this method returns YES, since getting the password may fail, or the user may refuse access.
        Returns:
        YES if this credential has a password, otherwise NO
      • identity

        public SecIdentityRef identity()
        Returns the SecIdentityRef of this credential, if it was created with a certificate and identity
        Returns:
        A SecIdentityRef or NULL if this is a username/password credential
      • initWithIdentityCertificatesPersistence

        public NSURLCredential initWithIdentityCertificatesPersistence​(SecIdentityRef identity,
                                                                       NSArray<?> certArray,
                                                                       long persistence)
        initWithIdentity:certificates:persistence: Initialize an NSURLCredential with an identity and array of at least 1 client certificates (SecCertificateRef)
        Parameters:
        identity - a SecIdentityRef object
        certArray - an array containing at least one SecCertificateRef objects
        persistence - enum that says to store per session, permanently or not at all
        Returns:
        the Initialized NSURLCredential
      • initWithTrust

        public NSURLCredential initWithTrust​(SecTrustRef trust)
        initWithTrust: Initialize a new NSURLCredential which specifies that the specified trust has been accepted.
        Returns:
        the Initialized NSURLCredential
      • initWithUserPasswordPersistence

        public NSURLCredential initWithUserPasswordPersistence​(java.lang.String user,
                                                               java.lang.String password,
                                                               long persistence)
        initWithUser:password:persistence: Initialize a NSURLCredential with a user and password
        Parameters:
        user - the username
        password - the password
        persistence - enum that says to store per session, permanently or not at all
        Returns:
        The initialized NSURLCredential
      • password

        public java.lang.String password()
        Get the password This method might actually attempt to retrieve the password from an external store, possible resulting in prompting, so do not call it unless needed.
        Returns:
        The password string
      • persistence

        public long persistence()
        Determine whether this credential is or should be stored persistently
        Returns:
        A value indicating whether this credential is stored permanently, per session or not at all.
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
      • user

        public java.lang.String user()
        Get the username
        Returns:
        The user string