Init() 공개 메소드

public Init ( bool forEncryption, ICipherParameters parameters ) : void
forEncryption bool
parameters ICipherParameters
리턴 void
예제 #1
0
 public virtual void Init(bool forEncryption, ICipherParameters parameters)
 {
     if (core == null)
     {
         core = new RsaCoreEngine();
     }
     core.Init(forEncryption, parameters);
 }
예제 #2
0
 public virtual void Init(bool forEncryption, ICipherParameters param)
 {
     core.Init(forEncryption, param);
     if (param is ParametersWithRandom)
     {
         ParametersWithRandom parametersWithRandom = (ParametersWithRandom)param;
         key    = (RsaKeyParameters)parametersWithRandom.Parameters;
         random = parametersWithRandom.Random;
     }
     else
     {
         key    = (RsaKeyParameters)param;
         random = new SecureRandom();
     }
 }
예제 #3
0
        public virtual void Init(bool forEncryption, ICipherParameters param)
        {
            RsaBlindingParameters rsaBlindingParameters;

            if (param is ParametersWithRandom)
            {
                ParametersWithRandom parametersWithRandom = (ParametersWithRandom)param;
                rsaBlindingParameters = (RsaBlindingParameters)parametersWithRandom.Parameters;
            }
            else
            {
                rsaBlindingParameters = (RsaBlindingParameters)param;
            }
            core.Init(forEncryption, rsaBlindingParameters.PublicKey);
            this.forEncryption = forEncryption;
            key            = rsaBlindingParameters.PublicKey;
            blindingFactor = rsaBlindingParameters.BlindingFactor;
        }
예제 #4
0
        /**
         * Initialise the blinding engine.
         *
         * @param forEncryption true if we are encrypting (blinding), false otherwise.
         * @param param         the necessary RSA key parameters.
         */
        public void Init(
            bool forEncryption,
            ICipherParameters param)
        {
            RsaBlindingParameters p;

            if (param is ParametersWithRandom)
            {
                ParametersWithRandom rParam = (ParametersWithRandom)param;

                p = (RsaBlindingParameters)rParam.Parameters;
            }
            else
            {
                p = (RsaBlindingParameters)param;
            }

            core.Init(forEncryption, p.PublicKey);

            this.forEncryption  = forEncryption;
            this.key            = p.PublicKey;
            this.blindingFactor = p.BlindingFactor;
        }