Esempio n. 1
0
 /// <summary>
 /// Get Name for goal
 /// </summary>
 /// <param name="value">GoalCodeEnum</param>
 /// <returns></returns>
 public static string goalName(this GoalCode value)
 {
     return(value.GetType()?
            .GetMember(value.ToString())?[0]?
            .GetCustomAttribute <DisplayAttribute>()?
            .Description);
 }
Esempio n. 2
0
 private void testSMSOutOfBandInvitationMsg(JsonObject msg, GoalCode goalCode)
 {
     testBaseMessage(msg);
     Assert.AreEqual("did:sov:123456789abcdefghi1234;spec/relationship/1.0/sms-out-of-band-invitation", msg.getAsString("@type"));
     Assert.IsTrue(msg.getAsString("goalCode").Equals(goalCode.code()));
     Assert.IsTrue(msg.getAsString("goal").Equals(goalCode.goalName()));
 }
Esempio n. 3
0
 /// <summary>
 /// Get Code for goal
 /// </summary>
 /// <param name="value">GoalCodeEnum</param>
 /// <returns></returns>
 public static string code(this GoalCode value)
 {
     return(value.GetType()?
            .GetMember(value.ToString())?[0]?
            .GetCustomAttribute <DisplayAttribute>()?
            .Name);
 }
Esempio n. 4
0
 private void testSMSOutOfBandInvitationMsg(JsonObject msg, GoalCode goalCode)
 {
     testBaseMessage(msg);
     Assert.AreEqual(Util.EVERNYM_MSG_QUALIFIER + "/relationship/1.0/sms-out-of-band-invitation", msg.getAsString("@type"));
     Assert.IsTrue(msg.getAsString("goalCode").Equals(goalCode.code()));
     Assert.IsTrue(msg.getAsString("goal").Equals(goalCode.goalName()));
 }
Esempio n. 5
0
 private void testOutOfBandInvitationMsg(JsonObject msg, bool hasShortInvite, GoalCode goalCode)
 {
     testBaseMessage(msg);
     Assert.AreEqual("did:sov:123456789abcdefghi1234;spec/relationship/1.0/out-of-band-invitation", msg.getAsString("@type"));
     Assert.IsTrue(msg.getAsString("goalCode").Equals(goalCode.code()));
     Assert.IsTrue(msg.getAsString("goal").Equals(goalCode.goalName()));
     if (hasShortInvite)
     {
         Assert.AreEqual(shortInvite, msg.getAsBoolean("shortInvite"));
     }
 }
Esempio n. 6
0
 private void testOutOfBandInvitationMsg(JsonObject msg, bool hasShortInvite, GoalCode goalCode)
 {
     testBaseMessage(msg);
     Assert.AreEqual(Util.EVERNYM_MSG_QUALIFIER + "/relationship/1.0/out-of-band-invitation", msg.getAsString("@type"));
     Assert.IsTrue(msg.getAsString("goalCode").Equals(goalCode.code()));
     Assert.IsTrue(msg.getAsString("goal").Equals(goalCode.goalName()));
     if (hasShortInvite)
     {
         Assert.AreEqual(shortInvite, msg.getAsBoolean("shortInvite"));
     }
 }
Esempio n. 7
0
 /// <summary>
 /// Creates and packages message without sending it.
 /// </summary>
 /// <param name="context">an instance of the Context object initialized to a verity-application agent</param>
 /// <param name="goal">the initial intended goal of the relationship (this goal is expressed in the invite)</param>
 /// <returns>the byte array ready for transport</returns>
 public byte[] smsOutOfBandInvitationMsgPacked(Context context, GoalCode goal)
 {
     return(packMsg(context, smsOutOfBandInvitationMsg(context, goal)));
 }
Esempio n. 8
0
 /// <summary>
 /// Ask for sending SMS aries out of band invitation from the verity-application agent for the relationship created by this protocol
 /// </summary>
 /// <param name="context">an instance of the Context object initialized to a verity-application agent</param>
 /// <param name="goal">the initial intended goal of the relationship (this goal is expressed in the invite)</param>
 public void smsOutOfBandInvitation(Context context, GoalCode goal)
 {
     send(context, smsOutOfBandInvitationMsg(context, goal));
 }
Esempio n. 9
0
 /// <summary>
 /// Creates and packages message without sending it.
 /// </summary>
 /// <param name="context">an instance of the Context object initialized to a verity-application agent</param>
 /// <param name="shortInvite">decides should short invite be provided as well</param>
 /// <param name="goal">the initial intended goal of the relationship (this goal is expressed in the invite)</param>
 /// <returns>the byte array ready for transport</returns>
 public byte[] outOfBandInvitationMsgPacked(Context context, bool shortInvite, GoalCode goal)
 {
     return(packMsg(context, outOfBandInvitationMsg(context, shortInvite, goal)));
 }
Esempio n. 10
0
 /// <summary>
 /// Ask for aries out of band invitation from the verity-application agent for the relationship created by this protocol
 /// </summary>
 /// <param name="context">an instance of the Context object initialized to a verity-application agent</param>
 /// <param name="shortInvite">decides should short invite be provided as well</param>
 /// <param name="goal">the initial intended goal of the relationship (this goal is expressed in the invite)</param>
 public void outOfBandInvitation(Context context, bool shortInvite, GoalCode goal)
 {
     send(context, outOfBandInvitationMsg(context, shortInvite, goal));
 }