/// <summary>
        /// Create a PibIdentityContainer using to use the pibImpl backend
        /// implementation. This constructor should only be called by the Pib class.
        /// </summary>
        ///
        /// <param name="pibImpl">The PIB backend implementation.</param>
        public PibIdentityContainer(PibImpl pibImpl)
        {
            this.identities_ = new Hashtable <Name, PibIdentityImpl>();
            pibImpl_         = pibImpl;

            if (pibImpl == null)
            {
                throw new AssertionError("The pibImpl is null");
            }

            identityNames_ = pibImpl_.getIdentities();
        }
Esempio n. 2
0
        /*
         * Create a Pib instance. This constructor should only be called by KeyChain.
         * @param scheme The scheme for the PIB.
         * @param location The location for the PIB.
         * @param pibImpl The PIB backend implementation.
         */
        public Pib(String scheme, String location, PibImpl pibImpl)
        {
            this.defaultIdentity_ = null;
            scheme_     = scheme;
            location_   = location;
            identities_ = new PibIdentityContainer(pibImpl);
            pibImpl_    = pibImpl;

            if (pibImpl == null)
            {
                throw new AssertionError("The pibImpl is null");
            }
        }
        /// <summary>
        /// Create a PibCertificateContainer for a key with keyName. This constructor
        /// should only be called by PibKeyImpl.
        /// </summary>
        ///
        /// <param name="keyName">The name of the key, which is copied.</param>
        /// <param name="pibImpl">The PIB backend implementation.</param>
        public PibCertificateContainer(Name keyName, PibImpl pibImpl)
        {
            this.certificates_ = new Hashtable <Name, CertificateV2>();
            keyName_           = new Name(keyName);
            pibImpl_           = pibImpl;

            if (pibImpl == null)
            {
                throw new AssertionError("The pibImpl is null");
            }

            certificateNames_ = pibImpl_.getCertificatesOfKey(keyName);
        }
Esempio n. 4
0
        /// <summary>
        /// Create a PibKeyContainer for an identity with identityName. This
        /// constructor should only be called by PibIdentityImpl.
        /// </summary>
        ///
        /// <param name="identityName">The name of the identity, which is copied.</param>
        /// <param name="pibImpl">The PIB backend implementation.</param>
        public PibKeyContainer(Name identityName, PibImpl pibImpl)
        {
            this.keys_ = new Hashtable <Name, PibKeyImpl>();
            // Copy the Name.
            identityName_ = new Name(identityName);
            pibImpl_      = pibImpl;

            if (pibImpl == null)
            {
                throw new AssertionError("The pibImpl is null");
            }

            keyNames_ = pibImpl_.getKeysOfIdentity(identityName);
        }