Changeset 1920337
- Timestamp:
- 08/06/2018 10:58:39 AM (8 years ago)
- Location:
- yoti
- Files:
-
- 165 added
- 19 edited
-
assets/banner-772x250.png (added)
-
trunk/YotiHelper.php (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/sdk/Yoti/ActivityDetails.php (modified) (18 diffs)
-
trunk/sdk/Yoti/Entity/Anchor.php (added)
-
trunk/sdk/Yoti/Entity/Attribute.php (added)
-
trunk/sdk/Yoti/Entity/Profile.php (added)
-
trunk/sdk/Yoti/Entity/SignedTimeStamp.php (added)
-
trunk/sdk/Yoti/Util/Profile (added)
-
trunk/sdk/Yoti/Util/Profile/AnchorProcessor.php (added)
-
trunk/sdk/Yoti/YotiClient.php (modified) (4 diffs)
-
trunk/sdk/attrpubapi_v1/Anchor.php (modified) (7 diffs)
-
trunk/sdk/attrpubapi_v1/Attribute.php (modified) (5 diffs)
-
trunk/sdk/attrpubapi_v1/AttributeAndId.php (modified) (3 diffs)
-
trunk/sdk/attrpubapi_v1/AttributeAndIdList.php (modified) (2 diffs)
-
trunk/sdk/attrpubapi_v1/AttributeList.php (modified) (2 diffs)
-
trunk/sdk/attrpubapi_v1/AttributeSigning.php (modified) (7 diffs)
-
trunk/sdk/attrpubapi_v1/ContentType.php (modified) (1 diff)
-
trunk/sdk/boot.php (modified) (1 diff)
-
trunk/sdk/compubapi_v1/EncryptedData.php (modified) (3 diffs)
-
trunk/sdk/compubapi_v1/SignedTimestamp.php (added)
-
trunk/sdk/phpseclib (added)
-
trunk/sdk/phpseclib/Crypt (added)
-
trunk/sdk/phpseclib/Crypt/AES.php (added)
-
trunk/sdk/phpseclib/Crypt/Base.php (added)
-
trunk/sdk/phpseclib/Crypt/Blowfish.php (added)
-
trunk/sdk/phpseclib/Crypt/DES.php (added)
-
trunk/sdk/phpseclib/Crypt/Hash.php (added)
-
trunk/sdk/phpseclib/Crypt/RC2.php (added)
-
trunk/sdk/phpseclib/Crypt/RC4.php (added)
-
trunk/sdk/phpseclib/Crypt/RSA.php (added)
-
trunk/sdk/phpseclib/Crypt/Random.php (added)
-
trunk/sdk/phpseclib/Crypt/Rijndael.php (added)
-
trunk/sdk/phpseclib/Crypt/TripleDES.php (added)
-
trunk/sdk/phpseclib/Crypt/Twofish.php (added)
-
trunk/sdk/phpseclib/File (added)
-
trunk/sdk/phpseclib/File/ANSI.php (added)
-
trunk/sdk/phpseclib/File/ASN1 (added)
-
trunk/sdk/phpseclib/File/ASN1.php (added)
-
trunk/sdk/phpseclib/File/ASN1/Element.php (added)
-
trunk/sdk/phpseclib/File/X509.php (added)
-
trunk/sdk/phpseclib/Math (added)
-
trunk/sdk/phpseclib/Math/BigInteger.php (added)
-
trunk/sdk/phpseclib/Net (added)
-
trunk/sdk/phpseclib/Net/SCP.php (added)
-
trunk/sdk/phpseclib/Net/SFTP (added)
-
trunk/sdk/phpseclib/Net/SFTP.php (added)
-
trunk/sdk/phpseclib/Net/SFTP/Stream.php (added)
-
trunk/sdk/phpseclib/Net/SSH1.php (added)
-
trunk/sdk/phpseclib/Net/SSH2.php (added)
-
trunk/sdk/phpseclib/System (added)
-
trunk/sdk/phpseclib/System/SSH (added)
-
trunk/sdk/phpseclib/System/SSH/Agent (added)
-
trunk/sdk/phpseclib/System/SSH/Agent.php (added)
-
trunk/sdk/phpseclib/System/SSH/Agent/Identity.php (added)
-
trunk/sdk/phpseclib/bootstrap.php (added)
-
trunk/sdk/phpseclib/openssl.cnf (added)
-
trunk/sdk/proto/Attribute.proto (modified) (3 diffs)
-
trunk/sdk/proto/EncryptedData.proto (modified) (2 diffs)
-
trunk/sdk/proto/List.proto (modified) (2 diffs)
-
trunk/sdk/proto/SignedTimeStamp.proto (added)
-
trunk/sdk/proto/Signing.proto (modified) (2 diffs)
-
trunk/sdk/protobuflib (added)
-
trunk/sdk/protobuflib/GPBMetadata (added)
-
trunk/sdk/protobuflib/GPBMetadata/Attribute.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/EncryptedData.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google/Protobuf (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google/Protobuf/Any.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google/Protobuf/Api.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google/Protobuf/Duration.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google/Protobuf/FieldMask.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google/Protobuf/GPBEmpty.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google/Protobuf/Internal (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google/Protobuf/Internal/Descriptor.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google/Protobuf/SourceContext.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google/Protobuf/Struct.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google/Protobuf/Timestamp.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google/Protobuf/Type.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/Google/Protobuf/Wrappers.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/ProtoList.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/SignedTimeStamp.php (added)
-
trunk/sdk/protobuflib/GPBMetadata/Signing.php (added)
-
trunk/sdk/protobuflib/Google (added)
-
trunk/sdk/protobuflib/Google/Protobuf (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Any.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Api.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/BoolValue.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/BytesValue.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Descriptor.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/DescriptorPool.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/DoubleValue.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Duration.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Enum.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/EnumDescriptor.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/EnumValue.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/EnumValueDescriptor.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Field.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/FieldDescriptor.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/FieldMask.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Field_Cardinality.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Field_Kind.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/FloatValue.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/GPBEmpty.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Int32Value.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Int64Value.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/CodedInputStream.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/CodedOutputStream.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/Descriptor.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/DescriptorPool.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/DescriptorProto.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/EnumBuilderContext.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/EnumDescriptor.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/EnumDescriptorProto.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/EnumOptions.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/EnumValueDescriptorProto.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/EnumValueOptions.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/ExtensionRangeOptions.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/FieldDescriptor.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/FieldDescriptorProto.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/FieldDescriptorProto_Label.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/FieldDescriptorProto_Type.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/FieldOptions.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/FieldOptions_CType.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/FieldOptions_JSType.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/FileDescriptor.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/FileDescriptorProto.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/FileDescriptorSet.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/FileOptions.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/FileOptions_OptimizeMode.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/GPBDecodeException.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/GPBJsonWire.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/GPBLabel.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/GPBType.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/GPBUtil.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/GPBWire.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/GPBWireType.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/GeneratedCodeInfo.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/GetPublicDescriptorTrait.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/HasPublicDescriptorTrait.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/MapEntry.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/MapField.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/MapFieldIter.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/Message.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/MessageBuilderContext.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/MessageOptions.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/MethodDescriptorProto.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/MethodOptions.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/OneofDescriptor.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/OneofDescriptorProto.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/OneofField.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/OneofOptions.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/RawInputStream.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/RepeatedField.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/RepeatedFieldIter.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/ServiceDescriptorProto.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/ServiceOptions.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/SourceCodeInfo.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/SourceCodeInfo_Location.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/UninterpretedOption.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Internal/UninterpretedOption_NamePart.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/ListValue.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Method.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Mixin.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/NullValue.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/OneofDescriptor.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Option.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/SourceContext.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/StringValue.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Struct.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Syntax.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Timestamp.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Type.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/UInt32Value.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/UInt64Value.php (added)
-
trunk/sdk/protobuflib/Google/Protobuf/Value.php (added)
-
trunk/views/admin-options.php (modified) (1 diff)
-
trunk/yoti.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
yoti/trunk/YotiHelper.php
r1840797 r1920337 21 21 * Yoti SDK javascript library. 22 22 */ 23 const YOTI_SDK_JAVASCRIPT_LIBRARY = 'https://sdk.yoti.com/clients/browser.2. 0.1.js';23 const YOTI_SDK_JAVASCRIPT_LIBRARY = 'https://sdk.yoti.com/clients/browser.2.1.0.js'; 24 24 25 25 const AGE_VERIFICATION_ATTR = 'age_verified'; -
yoti/trunk/readme.txt
r1852630 r1920337 6 6 Tested up to: 4.9.1 7 7 Requires PHP: 5.6 8 Stable tag: 1.1. 88 Stable tag: 1.1.9 9 9 License: GNU v3 10 10 License URI: https://www.gnu.org/licenses/gpl.txt … … 14 14 == Description == 15 15 16 Yoti is a digital identity platform that allows users to log in to your WordPress site—simply, securely and password free! Using a combination of our free identity app and our web based dashboard, we verify customer details against government issued ID documents before securely sending their details to you. Click here to learn [more.](https://www.yoti.com)17 18 This plugin also allows functionality to link your current followers to their Yoti accounts making registration and blogging quicker with a fancy button! 16 Yoti is a digital identity app that lets people log in to websites without a password and prove their identity online. 17 Just click on the login with Yoti button, scan secure QR code with the Yoti app and that’s it. 18 Get the Yoti plugin and let people log in to your WordPress websites without entering a password. Click here to learn [more.](https://www.yoti.com) 19 19 20 20 Here is a quick video on how to install the plugin in less than 5 minutes: … … 22 22 https://www.youtube.com/watch?v=kzltLNws1cQ 23 23 24 == Features==24 == Why does your website need Yoti == 25 25 26 * Faster logon using your Yoti app 27 * KYC and verification of your users 28 * Anonymous verification 29 * Automatic login to create blogs with ease 30 * No need for passwords 31 * Remember me functionality 32 * The ability for user to link and unlink WordPress account to Yoti account 26 * Stops keyloggers, by not having to type usernames and passwords. 27 * Stops phishing attacks, safer website access without usernames and passwords. 28 * Privacy by design. We use advanced hybrid 256-bit encryption to secure your personal information. 29 * No Passwords. Your users login securely by scanning a QR code. 30 * KYC checks. Verify the identities of your website users. 31 * Age verification. Verify the age of users of your website and control access to age-restricted content. 32 33 Download the free Yoti app [Android](https://play.google.com/store/apps/details?id=com.yoti.mobile.android.live) 34 Download the free Yoti app [IOS](https://itunes.apple.com/us/app/yoti/id983980808?ls=1&mt=8) 33 35 34 36 == Installation == 35 37 36 We have a few simple steps we need you to fill before you get started:37 38 = Requirements =39 40 * This plugin works with the WordPress Business Plan package.41 * You must also have downloaded the Yoti app with an ID document attached.42 43 38 = Step1: Installing the plugin = 44 39 45 Import the plugin into your WordPress dashboard: 46 47 1. Log on to your Wordpress Admin Dashboard: e.g. https://www.wordpress-url.org.uk/wp-admin 48 2. Navigate on the left hand side to Plugins > Add New 49 3. Search for Yoti and install it 50 4. Activate the plugin on the same screen 40 * From the “Plugins” menu search for “Yoti”, 41 * click “Install Now” and then “Activate”. 51 42 52 43 = Step 2: Setting up your Yoti Application = 53 44 54 If you are a business, please create a Yoti organisation by visiting [here.](https://www.yoti.com/dashboard/login-organisations) 45 Visit the Yoti Dashboard [here](https://www.yoti.com/dashboard/login-organisations) to create a new application for your organisation/business. 55 46 56 For information on how to create an organisation please visit our [developer site.](https://www.yoti.com/developers/documentation/#introduction) 47 Specify the basic details of your application such as the name, description and optional logo. These details can be whatever you desire and will not affect the plugin’s functionality. 57 48 58 Once this is completed, or for personal use please access the [dashboard](https://www.yoti.com/dashboard/login) to create a new application. Note: if you have completed your organisation steps above you will need to ensure you are within your organisation dashboard by: 49 The main page - Edit the application and set your website URL in the 'Application domain' section, e.g https:yourwebsite.com 59 50 60 * Clicking your profile photo on the top right 61 * Select organisation 51 The Scenarios tab - Scenarios are different instances where you request users for information using Yoti. e.g verify your users' age online or in person or quickly sign in users to your website without passwords. This plugin only support single scenario. 62 52 63 This will then lead you to create a new application. 53 * Specify a name for your scenario. 54 * Specify what information you want to request with this scenario. 55 * And finally, provide a callback URL so we know where to send your users after they have used Yoti. This URL must be a subdomain of your applications' domain. 64 56 65 Specify the basic details of your application such as the name, description and optional logo. These details can be whatever you desire and will not affect the plugin's functionality. 66 67 The Data tab - Specify any attributes you'd like users to share. You must select at least one. If you plan to allow new user registrations, we recommended choosing Given Name(s), Family Name and Email Address at a minimum. 68 69 The Integration tab - Here is where you specify the callback URL. The URL can be found by going to your Yoti settings page which is located in your WordPress admin dashboard. 70 71 NOTE: If you get redirected to your WordPress frontpage instead of the Admin area, simply add /wp-admin to the URL. 72 73 The Key tab - Here is where your keys are generated which will be inputted into the plugin settings. You will need to download your pem file and store it somewhere safe as it will be used as part of the plugin set up. 74 75 = Step 3: Plugin Setup = 76 77 To set things up, navigate on WordPress to Settings > Yoti. You will be asked to add the following information: 78 79 * Yoti App ID is the unique identifier of your specific application. 80 * Yoti Scenario ID is used to render the inline QR code. 81 * Yoti SDK ID is the SDK identifier generated by Yoti Dashboard in the Key tab when you create your app. Note this is not your Application Identifier, which is needed by your client-side code. 82 * Company Name will replace WordPress wording in the warning message displayed on the custom login form. 83 * Yoti PEM File is the application pem file. It can be downloaded only once from the Keys tab in your Yoti Dashboard. Please do not include the Zip File, just the pem file is adequate. 84 * Change your call back URL on Yoti Dashboard: Log in to your dashboard and change your call back URL to the one provided on your Yoti Settings page. This is located within your application, on the Integration tab 85 86 = Step 4: Adding the widget = 87 88 Now your Yoti plugin is all set up you will need to add the button to your WordPress page. 89 90 To do this navigate to Appearance -> Widgets. 91 92 Please place the Yoti Widget where you deem appropriate. 93 94 = Step 5: Testing = 95 96 Log out of your WordPress account and go back to your site. 97 98 Test the Yoti button. 99 100 = Extras: = 101 102 The Yoti plugin has been developed to allow existing users to link their account with the below use cases: 103 104 1) Only allow existing WordPress users to link their Yoti account - This setting will prevent a new user to register and/or login using Yoti if they don't already have an account on your WordPress website. If enabled, when a new user tries to scan the Yoti QR code, they will be redirected to the login/register page with an error message displayed. 105 106 2) Attempt to link Yoti email address with Wordpress account for first time users - This setting enables linking a Yoti account to a WordPress user if the email from both platforms is identical. 107 108 3) Prevent users who have not passed age verification to access your site - This setting will not allow someone who does not pass the age verification condition set in the Yoti Dashboard (e.g. over 18) to register or link their account with Yoti. 109 110 This is found in Yoti plugin settings. 57 The Keys tab – Here is where your keys are generated which will be inputted into the plugin settings. You will need to download your pem file and store it somewhere safe as it will be used as part of the plugin set up. 111 58 112 59 == Frequently Asked Questions == … … 128 75 129 76 Here you can find the changes for each version: 77 78 1.1.9 79 80 Release Date - 1 August 2018 81 82 * Update the Details and Installation section on the plugin page to reflect the changes from Yoti dashboard 83 * Update the banner on the plugin page 130 84 131 85 1.1.8 -
yoti/trunk/sdk/Yoti/ActivityDetails.php
r1852630 r1920337 2 2 namespace Yoti; 3 3 4 use attrpubapi_v1\Attribute;5 use attrpubapi_v1\AttributeList;6 4 use Yoti\Entity\Selfie; 5 use Yoti\Entity\Profile; 6 use Yoti\Entity\Attribute; 7 use Attrpubapi_v1\AttributeList; 7 8 use Yoti\Helper\ActivityDetailsHelper; 9 use Yoti\Util\Age\AgeUnderOverProcessor; 10 use Yoti\Util\Profile\AnchorProcessor; 8 11 9 12 /** … … 39 42 40 43 /** 44 * @var \Yoti\Entity\Profile 45 */ 46 private $profile; 47 48 /** 41 49 * @var ActivityDetailsHelper 42 50 */ … … 59 67 } 60 68 69 // Setting an empty profile here in case 70 // the constructor is called directly 71 $this->setProfile(new Profile([])); 72 61 73 $this->helper = new ActivityDetailsHelper($this); 62 74 } … … 72 84 public static function constructFromAttributeList(AttributeList $attributeList, $rememberMeId) 73 85 { 74 $attrs = array(); 75 76 foreach ($attributeList->getAttributesList() as $item) /** @var Attribute $item */ 86 // For ActivityDetails attributes 87 $attrs = []; 88 // For Profile attributes 89 $profileAttributes = []; 90 $ageConditionMetadata = []; 91 $anchorProcessor = new AnchorProcessor(); 92 93 foreach ($attributeList->getAttributes() as $item) /** @var Attribute $item */ 77 94 { 78 if($item->getName() === 'selfie')79 {80 $attrs[$ item->getName()] = new Selfie(81 $item->getValue() ->getContents(),82 $item->get ContentType()->name()95 $attrName = $item->getName(); 96 if ($attrName === 'selfie') { 97 $attrs[$attrName] = new Selfie( 98 $item->getValue(), 99 $item->getName() 83 100 ); 84 101 } 85 102 else { 86 $attrs[$ item->getName()] = $item->getValue()->getContents();103 $attrs[$attrName] = $item->getValue(); 87 104 } 105 // Build attribute object for user profile 106 $attrValue = $item->getValue(); 107 // Convert structured_postal_address value to an Array 108 if ($attrName === 'structured_postal_address') { 109 $attrValue = json_decode($attrValue, TRUE); 110 } 111 112 $attributeAnchors = $anchorProcessor->process($item->getAnchors()); 113 $attribute = new Attribute( 114 $attrName, 115 $attrValue, 116 $attributeAnchors['sources'], 117 $attributeAnchors['verifiers'] 118 ); 119 120 $profileAttributes[$attrName] = $attribute; 121 // Add 'is_age_verified' and 'verified_age' attributes 122 if (preg_match(AgeUnderOverProcessor::AGE_PATTERN, $attrName)) { 123 $ageConditionMetadata['sources'] = $attributeAnchors['sources']; 124 $ageConditionMetadata['verifiers'] = $attributeAnchors['verifiers']; 125 } 88 126 } 89 127 90 128 $inst = new self($attrs, $rememberMeId); 129 // Add 'age_condition' and 'verified_age' attributes values 130 if (!empty($ageConditionMetadata)) { 131 $profileAttributes[Attribute::AGE_CONDITION] = new Attribute( 132 Attribute::AGE_CONDITION, 133 $inst->isAgeVerified(), 134 $ageConditionMetadata['sources'], 135 $ageConditionMetadata['verifiers'] 136 ); 137 138 $profileAttributes[Attribute::VERIFIED_AGE] = new Attribute( 139 Attribute::VERIFIED_AGE, 140 $inst->getVerifiedAge(), 141 $ageConditionMetadata['sources'], 142 $ageConditionMetadata['verifiers'] 143 ); 144 } 145 $inst->setProfile(new Profile($profileAttributes)); 91 146 92 147 return $inst; … … 124 179 125 180 /** 181 * @param Profile $profile 182 */ 183 protected function setProfile(Profile $profile) 184 { 185 $this->profile = $profile; 186 } 187 188 /** 189 * Get user profile object. 190 * 191 * @return Profile 192 */ 193 public function getProfile() 194 { 195 return $this->profile; 196 } 197 198 /** 126 199 * Check if attribute exists. 127 200 * … … 148 221 * Get family name. 149 222 * 223 * @deprecated 1.2.0 224 * Use profile::getFamilyName() 225 * 150 226 * @return null|string 151 227 */ … … 158 234 * Get given names. 159 235 * 236 * @deprecated 1.2.0 237 * Use profile::getGivenNames() 238 * 160 239 * @return null|string 161 240 */ … … 168 247 * Get full name. 169 248 * 249 * @deprecated 1.2.0 250 * Use profile::getFullName() 251 * 170 252 * @return null|string 171 253 */ … … 178 260 * Get date of birth. 179 261 * 262 * @deprecated 1.2.0 263 * Use profile::getDateOfBirth() 264 * 180 265 * @return null|string 181 266 */ … … 188 273 * Get gender. 189 274 * 275 * @deprecated 1.2.0 276 * Use profile::getGender() 277 * 190 278 * @return null|string 191 279 */ … … 198 286 * Get user nationality. 199 287 * 288 * @deprecated 1.2.0 289 * Use profile::getNationality() 290 * 200 291 * @return null|string 201 292 */ … … 208 299 * Get user phone number. 209 300 * 301 * @deprecated 1.2.0 302 * Use profile::getPhoneNumber() 303 * 210 304 * @return null|string 211 305 */ … … 217 311 /** 218 312 * Get user selfie image data. 313 * 314 * @deprecated 1.2.0 315 * Use profile::getSelfie() 219 316 * 220 317 * @return null|string … … 235 332 * Get selfie image object. 236 333 * 334 * @deprecated 1.2.0 335 * 237 336 * @return null| \Yoti\Entity\Selfie $selfie 238 337 */ … … 247 346 * Get user email address. 248 347 * 348 * @deprecated 1.2.0 349 * Use profile::getEmailAddress() 350 * 249 351 * @return null|string 250 352 */ … … 257 359 * Get user address. 258 360 * 361 * @deprecated 1.2.0 362 * Use profile::getPostalAddress() 363 * 259 364 * @return null|string 260 365 */ 261 366 public function getPostalAddress() 262 367 { 263 return $this->getProfileAttribute(self::ATTR_POSTAL_ADDRESS); 264 } 265 266 /** 267 * Get user structured postal address as a JSON string. 268 * 269 * @return null|string 368 $postalAddress = $this->getProfileAttribute(self::ATTR_POSTAL_ADDRESS); 369 if (NULL === $postalAddress) { 370 // Get it from structured_postal_address.formatted_address 371 $structuredPostalAddress = $this->getStructuredPostalAddress(); 372 if ( 373 is_array($structuredPostalAddress) 374 && isset($structuredPostalAddress['formatted_address']) 375 ) { 376 $postalAddress = $structuredPostalAddress['formatted_address']; 377 } 378 } 379 return $postalAddress; 380 } 381 382 /** 383 * Get user structured postal address as an array. 384 * 385 * @deprecated 1.2.0 386 * Use profile::getStructuredPostalAddress() 387 * 388 * @return null|array 270 389 */ 271 390 public function getStructuredPostalAddress() 272 391 { 273 return $this->getProfileAttribute(self::ATTR_STRUCTURED_POSTAL_ADDRESS); 392 $structuredPostalAddress = $this->getProfileAttribute(self::ATTR_STRUCTURED_POSTAL_ADDRESS); 393 return json_decode($structuredPostalAddress, true); 274 394 } 275 395 … … 278 398 * Or null if the attribute is not set in the dashboard 279 399 * 400 * @deprecated 1.2.0 401 * Use profile::getAgeCondition() 402 * 280 403 * @return bool|null 281 404 */ … … 286 409 287 410 /** 411 * @deprecated 1.2.0 412 * Use profile::getVerifiedAge() 413 * 288 414 * @return null|string 289 415 */ -
yoti/trunk/sdk/Yoti/YotiClient.php
r1840797 r1920337 3 3 namespace Yoti; 4 4 5 use compubapi_v1\EncryptedData;5 use Compubapi_v1\EncryptedData; 6 6 use Yoti\Http\Payload; 7 7 use Yoti\Http\AmlResult; … … 431 431 * @param $profileContent 432 432 * 433 * @return \ compubapi_v1\EncryptedData433 * @return \Compubapi_v1\EncryptedData 434 434 */ 435 435 private function getEncryptedData($profileContent) 436 436 { 437 437 // Get cipher_text and iv 438 $encryptedData = new EncryptedData(base64_decode($profileContent)); 438 $encryptedData = new EncryptedData(); 439 $encryptedData->mergeFromString(base64_decode($profileContent)); 439 440 440 441 return $encryptedData; … … 447 448 * @param $wrappedReceiptKey 448 449 * 449 * @return \ attrpubapi_v1\AttributeList450 * @return \Attrpubapi_v1\AttributeList 450 451 */ 451 452 private function getAttributeList(EncryptedData $encryptedData, $wrappedReceiptKey) … … 463 464 ); 464 465 465 $attributeList = new \attrpubapi_v1\AttributeList($cipherText); 466 $attributeList = new \Attrpubapi_v1\AttributeList(); 467 $attributeList->mergeFromString($cipherText); 466 468 467 469 return $attributeList; -
yoti/trunk/sdk/attrpubapi_v1/Anchor.php
r1707648 r1920337 1 1 <?php 2 /** 3 * Generated by Protobuf protoc plugin. 4 * 5 * File descriptor : Attribute.proto 6 */ 2 # Generated by the protocol buffer compiler. DO NOT EDIT! 3 # source: Attribute.proto 7 4 5 namespace Attrpubapi_v1; 8 6 9 namespace attrpubapi_v1;7 use Google\Protobuf\Internal\GPBUtil; 10 8 11 9 /** 12 * Protobuf message : attrpubapi_v1.Anchor10 * Generated from protobuf message <code>attrpubapi_v1.Anchor</code> 13 11 */ 14 class Anchor extends \ Protobuf\AbstractMessage12 class Anchor extends \Google\Protobuf\Internal\Message 15 13 { 14 /** 15 * Generated from protobuf field <code>bytes artifact_link = 1;</code> 16 */ 17 private $artifact_link = ''; 18 /** 19 * Generated from protobuf field <code>repeated bytes origin_server_certs = 2;</code> 20 */ 21 private $origin_server_certs; 22 /** 23 * Generated from protobuf field <code>bytes artifact_signature = 3;</code> 24 */ 25 private $artifact_signature = ''; 26 /** 27 * Generated from protobuf field <code>string sub_type = 4;</code> 28 */ 29 private $sub_type = ''; 30 /** 31 * Generated from protobuf field <code>bytes signature = 5;</code> 32 */ 33 private $signature = ''; 34 /** 35 * Generated from protobuf field <code>bytes signed_time_stamp = 6;</code> 36 */ 37 private $signed_time_stamp = ''; 16 38 17 /** 18 * @var \Protobuf\UnknownFieldSet 19 */ 20 protected $unknownFieldSet = null; 21 22 /** 23 * @var \Protobuf\Extension\ExtensionFieldMap 24 */ 25 protected $extensions = null; 26 27 /** 28 * artifact_link optional bytes = 1 29 * 30 * @var \Protobuf\Stream 31 */ 32 protected $artifact_link = null; 33 34 /** 35 * origin_server_certs repeated bytes = 2 36 * 37 * @var \Protobuf\Collection 38 */ 39 protected $origin_server_certs = null; 40 41 /** 42 * artifact_signature optional bytes = 3 43 * 44 * @var \Protobuf\Stream 45 */ 46 protected $artifact_signature = null; 47 48 /** 49 * sub_type optional string = 4 50 * 51 * @var string 52 */ 53 protected $sub_type = null; 54 55 /** 56 * signature optional bytes = 5 57 * 58 * @var \Protobuf\Stream 59 */ 60 protected $signature = null; 61 62 /** 63 * signed_time_stamp optional bytes = 6 64 * 65 * @var \Protobuf\Stream 66 */ 67 protected $signed_time_stamp = null; 68 69 /** 70 * Check if 'artifact_link' has a value 71 * 72 * @return bool 73 */ 74 public function hasArtifactLink() 75 { 76 return $this->artifact_link !== null; 39 public function __construct() { 40 \GPBMetadata\Attribute::initOnce(); 41 parent::__construct(); 77 42 } 78 43 79 44 /** 80 * Get 'artifact_link' value 81 * 82 * @return \Protobuf\Stream 45 * Generated from protobuf field <code>bytes artifact_link = 1;</code> 46 * @return string 83 47 */ 84 48 public function getArtifactLink() … … 88 52 89 53 /** 90 * Set 'artifact_link' value91 * 92 * @ param \Protobuf\Stream $value54 * Generated from protobuf field <code>bytes artifact_link = 1;</code> 55 * @param string $var 56 * @return $this 93 57 */ 94 public function setArtifactLink($va lue = null)58 public function setArtifactLink($var) 95 59 { 96 if ($value !== null && ! $value instanceof \Protobuf\Stream) { 97 $value = \Protobuf\Stream::wrap($value); 98 } 60 GPBUtil::checkString($var, False); 61 $this->artifact_link = $var; 99 62 100 $this->artifact_link = $value;63 return $this; 101 64 } 102 65 103 66 /** 104 * Check if 'origin_server_certs' has a value 105 * 106 * @return bool 67 * Generated from protobuf field <code>repeated bytes origin_server_certs = 2;</code> 68 * @return \Google\Protobuf\Internal\RepeatedField 107 69 */ 108 public function hasOriginServerCertsList() 109 { 110 return $this->origin_server_certs !== null; 111 } 112 113 /** 114 * Get 'origin_server_certs' value 115 * 116 * @return \Protobuf\Collection 117 */ 118 public function getOriginServerCertsList() 70 public function getOriginServerCerts() 119 71 { 120 72 return $this->origin_server_certs; … … 122 74 123 75 /** 124 * Set 'origin_server_certs' value125 * 126 * @ param \Protobuf\Collection $value76 * Generated from protobuf field <code>repeated bytes origin_server_certs = 2;</code> 77 * @param string[]|\Google\Protobuf\Internal\RepeatedField $var 78 * @return $this 127 79 */ 128 public function setOriginServerCerts List(\Protobuf\Collection $value = null)80 public function setOriginServerCerts($var) 129 81 { 130 $this->origin_server_certs = $value; 82 $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); 83 $this->origin_server_certs = $arr; 84 85 return $this; 131 86 } 132 87 133 88 /** 134 * Add a new element to 'origin_server_certs' 135 * 136 * @param \Protobuf\Stream $value 137 */ 138 public function addOriginServerCerts($value) 139 { 140 if ($this->origin_server_certs === null) { 141 $this->origin_server_certs = new \Protobuf\StreamCollection(); 142 } 143 144 $this->origin_server_certs->add(\Protobuf\Stream::wrap($value)); 145 } 146 147 /** 148 * Check if 'artifact_signature' has a value 149 * 150 * @return bool 151 */ 152 public function hasArtifactSignature() 153 { 154 return $this->artifact_signature !== null; 155 } 156 157 /** 158 * Get 'artifact_signature' value 159 * 160 * @return \Protobuf\Stream 89 * Generated from protobuf field <code>bytes artifact_signature = 3;</code> 90 * @return string 161 91 */ 162 92 public function getArtifactSignature() … … 166 96 167 97 /** 168 * Set 'artifact_signature' value169 * 170 * @ param \Protobuf\Stream $value98 * Generated from protobuf field <code>bytes artifact_signature = 3;</code> 99 * @param string $var 100 * @return $this 171 101 */ 172 public function setArtifactSignature($va lue = null)102 public function setArtifactSignature($var) 173 103 { 174 if ($value !== null && ! $value instanceof \Protobuf\Stream) { 175 $value = \Protobuf\Stream::wrap($value); 176 } 104 GPBUtil::checkString($var, False); 105 $this->artifact_signature = $var; 177 106 178 $this->artifact_signature = $value;107 return $this; 179 108 } 180 109 181 110 /** 182 * Check if 'sub_type' has a value 183 * 184 * @return bool 185 */ 186 public function hasSubType() 187 { 188 return $this->sub_type !== null; 189 } 190 191 /** 192 * Get 'sub_type' value 193 * 111 * Generated from protobuf field <code>string sub_type = 4;</code> 194 112 * @return string 195 113 */ … … 200 118 201 119 /** 202 * Set 'sub_type' value203 * 204 * @ param string $value120 * Generated from protobuf field <code>string sub_type = 4;</code> 121 * @param string $var 122 * @return $this 205 123 */ 206 public function setSubType($va lue = null)124 public function setSubType($var) 207 125 { 208 $this->sub_type = $value; 126 GPBUtil::checkString($var, True); 127 $this->sub_type = $var; 128 129 return $this; 209 130 } 210 131 211 132 /** 212 * Check if 'signature' has a value 213 * 214 * @return bool 215 */ 216 public function hasSignature() 217 { 218 return $this->signature !== null; 219 } 220 221 /** 222 * Get 'signature' value 223 * 224 * @return \Protobuf\Stream 133 * Generated from protobuf field <code>bytes signature = 5;</code> 134 * @return string 225 135 */ 226 136 public function getSignature() … … 230 140 231 141 /** 232 * Set 'signature' value233 * 234 * @ param \Protobuf\Stream $value142 * Generated from protobuf field <code>bytes signature = 5;</code> 143 * @param string $var 144 * @return $this 235 145 */ 236 public function setSignature($va lue = null)146 public function setSignature($var) 237 147 { 238 if ($value !== null && ! $value instanceof \Protobuf\Stream) { 239 $value = \Protobuf\Stream::wrap($value); 240 } 148 GPBUtil::checkString($var, False); 149 $this->signature = $var; 241 150 242 $this->signature = $value;151 return $this; 243 152 } 244 153 245 154 /** 246 * Check if 'signed_time_stamp' has a value 247 * 248 * @return bool 249 */ 250 public function hasSignedTimeStamp() 251 { 252 return $this->signed_time_stamp !== null; 253 } 254 255 /** 256 * Get 'signed_time_stamp' value 257 * 258 * @return \Protobuf\Stream 155 * Generated from protobuf field <code>bytes signed_time_stamp = 6;</code> 156 * @return string 259 157 */ 260 158 public function getSignedTimeStamp() … … 264 162 265 163 /** 266 * Set 'signed_time_stamp' value267 * 268 * @ param \Protobuf\Stream $value164 * Generated from protobuf field <code>bytes signed_time_stamp = 6;</code> 165 * @param string $var 166 * @return $this 269 167 */ 270 public function setSignedTimeStamp($va lue = null)168 public function setSignedTimeStamp($var) 271 169 { 272 if ($value !== null && ! $value instanceof \Protobuf\Stream) { 273 $value = \Protobuf\Stream::wrap($value); 274 } 170 GPBUtil::checkString($var, False); 171 $this->signed_time_stamp = $var; 275 172 276 $this->signed_time_stamp = $value;173 return $this; 277 174 } 278 279 /**280 * {@inheritdoc}281 */282 public function extensions()283 {284 if ( $this->extensions !== null) {285 return $this->extensions;286 }287 288 return $this->extensions = new \Protobuf\Extension\ExtensionFieldMap(__CLASS__);289 }290 291 /**292 * {@inheritdoc}293 */294 public function unknownFieldSet()295 {296 return $this->unknownFieldSet;297 }298 299 /**300 * {@inheritdoc}301 */302 public static function fromStream($stream, \Protobuf\Configuration $configuration = null)303 {304 return new self($stream, $configuration);305 }306 307 /**308 * {@inheritdoc}309 */310 public static function fromArray(array $values)311 {312 $message = new self();313 $values = array_merge([314 'artifact_link' => null,315 'origin_server_certs' => [],316 'artifact_signature' => null,317 'sub_type' => null,318 'signature' => null,319 'signed_time_stamp' => null320 ], $values);321 322 $message->setArtifactLink($values['artifact_link']);323 $message->setArtifactSignature($values['artifact_signature']);324 $message->setSubType($values['sub_type']);325 $message->setSignature($values['signature']);326 $message->setSignedTimeStamp($values['signed_time_stamp']);327 328 foreach ($values['origin_server_certs'] as $item) {329 $message->addOriginServerCerts($item);330 }331 332 return $message;333 }334 335 /**336 * {@inheritdoc}337 */338 public static function descriptor()339 {340 return \google\protobuf\DescriptorProto::fromArray([341 'name' => 'Anchor',342 'field' => [343 \google\protobuf\FieldDescriptorProto::fromArray([344 'number' => 1,345 'name' => 'artifact_link',346 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_BYTES(),347 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()348 ]),349 \google\protobuf\FieldDescriptorProto::fromArray([350 'number' => 2,351 'name' => 'origin_server_certs',352 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_BYTES(),353 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_REPEATED()354 ]),355 \google\protobuf\FieldDescriptorProto::fromArray([356 'number' => 3,357 'name' => 'artifact_signature',358 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_BYTES(),359 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()360 ]),361 \google\protobuf\FieldDescriptorProto::fromArray([362 'number' => 4,363 'name' => 'sub_type',364 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_STRING(),365 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()366 ]),367 \google\protobuf\FieldDescriptorProto::fromArray([368 'number' => 5,369 'name' => 'signature',370 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_BYTES(),371 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()372 ]),373 \google\protobuf\FieldDescriptorProto::fromArray([374 'number' => 6,375 'name' => 'signed_time_stamp',376 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_BYTES(),377 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()378 ]),379 ],380 ]);381 }382 383 /**384 * {@inheritdoc}385 */386 public function toStream(\Protobuf\Configuration $configuration = null)387 {388 $config = $configuration ?: \Protobuf\Configuration::getInstance();389 $context = $config->createWriteContext();390 $stream = $context->getStream();391 392 $this->writeTo($context);393 $stream->seek(0);394 395 return $stream;396 }397 398 /**399 * {@inheritdoc}400 */401 public function writeTo(\Protobuf\WriteContext $context)402 {403 $stream = $context->getStream();404 $writer = $context->getWriter();405 $sizeContext = $context->getComputeSizeContext();406 407 if ($this->artifact_link !== null) {408 $writer->writeVarint($stream, 10);409 $writer->writeByteStream($stream, $this->artifact_link);410 }411 412 if ($this->origin_server_certs !== null) {413 foreach ($this->origin_server_certs as $val) {414 $writer->writeVarint($stream, 18);415 $writer->writeByteStream($stream, $val);416 }417 }418 419 if ($this->artifact_signature !== null) {420 $writer->writeVarint($stream, 26);421 $writer->writeByteStream($stream, $this->artifact_signature);422 }423 424 if ($this->sub_type !== null) {425 $writer->writeVarint($stream, 34);426 $writer->writeString($stream, $this->sub_type);427 }428 429 if ($this->signature !== null) {430 $writer->writeVarint($stream, 42);431 $writer->writeByteStream($stream, $this->signature);432 }433 434 if ($this->signed_time_stamp !== null) {435 $writer->writeVarint($stream, 50);436 $writer->writeByteStream($stream, $this->signed_time_stamp);437 }438 439 if ($this->extensions !== null) {440 $this->extensions->writeTo($context);441 }442 443 return $stream;444 }445 446 /**447 * {@inheritdoc}448 */449 public function readFrom(\Protobuf\ReadContext $context)450 {451 $reader = $context->getReader();452 $length = $context->getLength();453 $stream = $context->getStream();454 455 $limit = ($length !== null)456 ? ($stream->tell() + $length)457 : null;458 459 while ($limit === null || $stream->tell() < $limit) {460 461 if ($stream->eof()) {462 break;463 }464 465 $key = $reader->readVarint($stream);466 $wire = \Protobuf\WireFormat::getTagWireType($key);467 $tag = \Protobuf\WireFormat::getTagFieldNumber($key);468 469 if ($stream->eof()) {470 break;471 }472 473 if ($tag === 1) {474 \Protobuf\WireFormat::assertWireType($wire, 12);475 476 $this->artifact_link = $reader->readByteStream($stream);477 478 continue;479 }480 481 if ($tag === 2) {482 \Protobuf\WireFormat::assertWireType($wire, 12);483 484 if ($this->origin_server_certs === null) {485 $this->origin_server_certs = new \Protobuf\StreamCollection();486 }487 488 $this->origin_server_certs->add($reader->readByteStream($stream));489 490 continue;491 }492 493 if ($tag === 3) {494 \Protobuf\WireFormat::assertWireType($wire, 12);495 496 $this->artifact_signature = $reader->readByteStream($stream);497 498 continue;499 }500 501 if ($tag === 4) {502 \Protobuf\WireFormat::assertWireType($wire, 9);503 504 $this->sub_type = $reader->readString($stream);505 506 continue;507 }508 509 if ($tag === 5) {510 \Protobuf\WireFormat::assertWireType($wire, 12);511 512 $this->signature = $reader->readByteStream($stream);513 514 continue;515 }516 517 if ($tag === 6) {518 \Protobuf\WireFormat::assertWireType($wire, 12);519 520 $this->signed_time_stamp = $reader->readByteStream($stream);521 522 continue;523 }524 525 $extensions = $context->getExtensionRegistry();526 $extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;527 528 if ($extension !== null) {529 $this->extensions()->add($extension, $extension->readFrom($context, $wire));530 531 continue;532 }533 534 if ($this->unknownFieldSet === null) {535 $this->unknownFieldSet = new \Protobuf\UnknownFieldSet();536 }537 538 $data = $reader->readUnknown($stream, $wire);539 $unknown = new \Protobuf\Unknown($tag, $wire, $data);540 541 $this->unknownFieldSet->add($unknown);542 543 }544 }545 546 /**547 * {@inheritdoc}548 */549 public function serializedSize(\Protobuf\ComputeSizeContext $context)550 {551 $calculator = $context->getSizeCalculator();552 $size = 0;553 554 if ($this->artifact_link !== null) {555 $size += 1;556 $size += $calculator->computeByteStreamSize($this->artifact_link);557 }558 559 if ($this->origin_server_certs !== null) {560 foreach ($this->origin_server_certs as $val) {561 $size += 1;562 $size += $calculator->computeByteStreamSize($val);563 }564 }565 566 if ($this->artifact_signature !== null) {567 $size += 1;568 $size += $calculator->computeByteStreamSize($this->artifact_signature);569 }570 571 if ($this->sub_type !== null) {572 $size += 1;573 $size += $calculator->computeStringSize($this->sub_type);574 }575 576 if ($this->signature !== null) {577 $size += 1;578 $size += $calculator->computeByteStreamSize($this->signature);579 }580 581 if ($this->signed_time_stamp !== null) {582 $size += 1;583 $size += $calculator->computeByteStreamSize($this->signed_time_stamp);584 }585 586 if ($this->extensions !== null) {587 $size += $this->extensions->serializedSize($context);588 }589 590 return $size;591 }592 593 /**594 * {@inheritdoc}595 */596 public function clear()597 {598 $this->artifact_link = null;599 $this->origin_server_certs = null;600 $this->artifact_signature = null;601 $this->sub_type = null;602 $this->signature = null;603 $this->signed_time_stamp = null;604 }605 606 /**607 * {@inheritdoc}608 */609 public function merge(\Protobuf\Message $message)610 {611 if ( ! $message instanceof \attrpubapi_v1\Anchor) {612 throw new \InvalidArgumentException(sprintf('Argument 1 passed to %s must be a %s, %s given', __METHOD__, __CLASS__, get_class($message)));613 }614 615 $this->artifact_link = ($message->artifact_link !== null) ? $message->artifact_link : $this->artifact_link;616 $this->origin_server_certs = ($message->origin_server_certs !== null) ? $message->origin_server_certs : $this->origin_server_certs;617 $this->artifact_signature = ($message->artifact_signature !== null) ? $message->artifact_signature : $this->artifact_signature;618 $this->sub_type = ($message->sub_type !== null) ? $message->sub_type : $this->sub_type;619 $this->signature = ($message->signature !== null) ? $message->signature : $this->signature;620 $this->signed_time_stamp = ($message->signed_time_stamp !== null) ? $message->signed_time_stamp : $this->signed_time_stamp;621 }622 623 175 624 176 } -
yoti/trunk/sdk/attrpubapi_v1/Attribute.php
r1707648 r1920337 1 1 <?php 2 /** 3 * Generated by Protobuf protoc plugin. 4 * 5 * File descriptor : Attribute.proto 6 */ 2 # Generated by the protocol buffer compiler. DO NOT EDIT! 3 # source: Attribute.proto 7 4 5 namespace Attrpubapi_v1; 8 6 9 namespace attrpubapi_v1;7 use Google\Protobuf\Internal\GPBUtil; 10 8 11 9 /** 12 * Protobuf message : attrpubapi_v1.Attribute10 * Generated from protobuf message <code>attrpubapi_v1.Attribute</code> 13 11 */ 14 class Attribute extends \ Protobuf\AbstractMessage12 class Attribute extends \Google\Protobuf\Internal\Message 15 13 { 14 /** 15 * Generated from protobuf field <code>string name = 1;</code> 16 */ 17 private $name = ''; 18 /** 19 * Generated from protobuf field <code>bytes value = 2;</code> 20 */ 21 private $value = ''; 22 /** 23 * Generated from protobuf field <code>.attrpubapi_v1.ContentType content_type = 3;</code> 24 */ 25 private $content_type = 0; 26 /** 27 * Generated from protobuf field <code>repeated .attrpubapi_v1.Anchor anchors = 4;</code> 28 */ 29 private $anchors; 16 30 17 /** 18 * @var \Protobuf\UnknownFieldSet 19 */ 20 protected $unknownFieldSet = null; 21 22 /** 23 * @var \Protobuf\Extension\ExtensionFieldMap 24 */ 25 protected $extensions = null; 26 27 /** 28 * name optional string = 1 29 * 30 * @var string 31 */ 32 protected $name = null; 33 34 /** 35 * value optional bytes = 2 36 * 37 * @var \Protobuf\Stream 38 */ 39 protected $value = null; 40 41 /** 42 * content_type optional enum = 3 43 * 44 * @var \attrpubapi_v1\ContentType 45 */ 46 protected $content_type = null; 47 48 /** 49 * anchors repeated message = 4 50 * 51 * @var \Protobuf\Collection<\attrpubapi_v1\Anchor> 52 */ 53 protected $anchors = null; 54 55 /** 56 * Check if 'name' has a value 57 * 58 * @return bool 59 */ 60 public function hasName() 61 { 62 return $this->name !== null; 31 public function __construct() { 32 \GPBMetadata\Attribute::initOnce(); 33 parent::__construct(); 63 34 } 64 35 65 36 /** 66 * Get 'name' value 67 * 37 * Generated from protobuf field <code>string name = 1;</code> 68 38 * @return string 69 39 */ … … 74 44 75 45 /** 76 * Set 'name' value77 * 78 * @ param string $value46 * Generated from protobuf field <code>string name = 1;</code> 47 * @param string $var 48 * @return $this 79 49 */ 80 public function setName($va lue = null)50 public function setName($var) 81 51 { 82 $this->name = $value; 52 GPBUtil::checkString($var, True); 53 $this->name = $var; 54 55 return $this; 83 56 } 84 57 85 58 /** 86 * Check if 'value' has a value 87 * 88 * @return bool 89 */ 90 public function hasValue() 91 { 92 return $this->value !== null; 93 } 94 95 /** 96 * Get 'value' value 97 * 98 * @return \Protobuf\Stream 59 * Generated from protobuf field <code>bytes value = 2;</code> 60 * @return string 99 61 */ 100 62 public function getValue() … … 104 66 105 67 /** 106 * Set 'value' value107 * 108 * @ param \Protobuf\Stream $value68 * Generated from protobuf field <code>bytes value = 2;</code> 69 * @param string $var 70 * @return $this 109 71 */ 110 public function setValue($va lue = null)72 public function setValue($var) 111 73 { 112 if ($value !== null && ! $value instanceof \Protobuf\Stream) { 113 $value = \Protobuf\Stream::wrap($value); 114 } 74 GPBUtil::checkString($var, False); 75 $this->value = $var; 115 76 116 $this->value = $value;77 return $this; 117 78 } 118 79 119 80 /** 120 * Check if 'content_type' has a value 121 * 122 * @return bool 123 */ 124 public function hasContentType() 125 { 126 return $this->content_type !== null; 127 } 128 129 /** 130 * Get 'content_type' value 131 * 132 * @return \attrpubapi_v1\ContentType 81 * Generated from protobuf field <code>.attrpubapi_v1.ContentType content_type = 3;</code> 82 * @return int 133 83 */ 134 84 public function getContentType() … … 138 88 139 89 /** 140 * Set 'content_type' value141 * 142 * @ param \attrpubapi_v1\ContentType $value90 * Generated from protobuf field <code>.attrpubapi_v1.ContentType content_type = 3;</code> 91 * @param int $var 92 * @return $this 143 93 */ 144 public function setContentType( \attrpubapi_v1\ContentType $value = null)94 public function setContentType($var) 145 95 { 146 $this->content_type = $value; 96 GPBUtil::checkEnum($var, \Attrpubapi_v1\ContentType::class); 97 $this->content_type = $var; 98 99 return $this; 147 100 } 148 101 149 102 /** 150 * Check if 'anchors' has a value 151 * 152 * @return bool 103 * Generated from protobuf field <code>repeated .attrpubapi_v1.Anchor anchors = 4;</code> 104 * @return \Google\Protobuf\Internal\RepeatedField 153 105 */ 154 public function hasAnchorsList() 155 { 156 return $this->anchors !== null; 157 } 158 159 /** 160 * Get 'anchors' value 161 * 162 * @return \Protobuf\Collection<\attrpubapi_v1\Anchor> 163 */ 164 public function getAnchorsList() 106 public function getAnchors() 165 107 { 166 108 return $this->anchors; … … 168 110 169 111 /** 170 * Set 'anchors' value171 * 172 * @ param \Protobuf\Collection<\attrpubapi_v1\Anchor> $value112 * Generated from protobuf field <code>repeated .attrpubapi_v1.Anchor anchors = 4;</code> 113 * @param \Attrpubapi_v1\Anchor[]|\Google\Protobuf\Internal\RepeatedField $var 114 * @return $this 173 115 */ 174 public function setAnchors List(\Protobuf\Collection $value = null)116 public function setAnchors($var) 175 117 { 176 $this->anchors = $value; 118 $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Attrpubapi_v1\Anchor::class); 119 $this->anchors = $arr; 120 121 return $this; 177 122 } 178 179 /**180 * Add a new element to 'anchors'181 *182 * @param \attrpubapi_v1\Anchor $value183 */184 public function addAnchors(\attrpubapi_v1\Anchor $value)185 {186 if ($this->anchors === null) {187 $this->anchors = new \Protobuf\MessageCollection();188 }189 190 $this->anchors->add($value);191 }192 193 /**194 * {@inheritdoc}195 */196 public function extensions()197 {198 if ( $this->extensions !== null) {199 return $this->extensions;200 }201 202 return $this->extensions = new \Protobuf\Extension\ExtensionFieldMap(__CLASS__);203 }204 205 /**206 * {@inheritdoc}207 */208 public function unknownFieldSet()209 {210 return $this->unknownFieldSet;211 }212 213 /**214 * {@inheritdoc}215 */216 public static function fromStream($stream, \Protobuf\Configuration $configuration = null)217 {218 return new self($stream, $configuration);219 }220 221 /**222 * {@inheritdoc}223 */224 public static function fromArray(array $values)225 {226 $message = new self();227 $values = array_merge([228 'name' => null,229 'value' => null,230 'content_type' => null,231 'anchors' => []232 ], $values);233 234 $message->setName($values['name']);235 $message->setValue($values['value']);236 $message->setContentType($values['content_type']);237 238 foreach ($values['anchors'] as $item) {239 $message->addAnchors($item);240 }241 242 return $message;243 }244 245 /**246 * {@inheritdoc}247 */248 public static function descriptor()249 {250 return \google\protobuf\DescriptorProto::fromArray([251 'name' => 'Attribute',252 'field' => [253 \google\protobuf\FieldDescriptorProto::fromArray([254 'number' => 1,255 'name' => 'name',256 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_STRING(),257 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()258 ]),259 \google\protobuf\FieldDescriptorProto::fromArray([260 'number' => 2,261 'name' => 'value',262 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_BYTES(),263 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()264 ]),265 \google\protobuf\FieldDescriptorProto::fromArray([266 'number' => 3,267 'name' => 'content_type',268 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_ENUM(),269 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL(),270 'type_name' => '.attrpubapi_v1.ContentType'271 ]),272 \google\protobuf\FieldDescriptorProto::fromArray([273 'number' => 4,274 'name' => 'anchors',275 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_MESSAGE(),276 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_REPEATED(),277 'type_name' => '.attrpubapi_v1.Anchor'278 ]),279 ],280 ]);281 }282 283 /**284 * {@inheritdoc}285 */286 public function toStream(\Protobuf\Configuration $configuration = null)287 {288 $config = $configuration ?: \Protobuf\Configuration::getInstance();289 $context = $config->createWriteContext();290 $stream = $context->getStream();291 292 $this->writeTo($context);293 $stream->seek(0);294 295 return $stream;296 }297 298 /**299 * {@inheritdoc}300 */301 public function writeTo(\Protobuf\WriteContext $context)302 {303 $stream = $context->getStream();304 $writer = $context->getWriter();305 $sizeContext = $context->getComputeSizeContext();306 307 if ($this->name !== null) {308 $writer->writeVarint($stream, 10);309 $writer->writeString($stream, $this->name);310 }311 312 if ($this->value !== null) {313 $writer->writeVarint($stream, 18);314 $writer->writeByteStream($stream, $this->value);315 }316 317 if ($this->content_type !== null) {318 $writer->writeVarint($stream, 24);319 $writer->writeVarint($stream, $this->content_type->value());320 }321 322 if ($this->anchors !== null) {323 foreach ($this->anchors as $val) {324 $writer->writeVarint($stream, 34);325 $writer->writeVarint($stream, $val->serializedSize($sizeContext));326 $val->writeTo($context);327 }328 }329 330 if ($this->extensions !== null) {331 $this->extensions->writeTo($context);332 }333 334 return $stream;335 }336 337 /**338 * {@inheritdoc}339 */340 public function readFrom(\Protobuf\ReadContext $context)341 {342 $reader = $context->getReader();343 $length = $context->getLength();344 $stream = $context->getStream();345 346 $limit = ($length !== null)347 ? ($stream->tell() + $length)348 : null;349 350 while ($limit === null || $stream->tell() < $limit) {351 352 if ($stream->eof()) {353 break;354 }355 356 $key = $reader->readVarint($stream);357 $wire = \Protobuf\WireFormat::getTagWireType($key);358 $tag = \Protobuf\WireFormat::getTagFieldNumber($key);359 360 if ($stream->eof()) {361 break;362 }363 364 if ($tag === 1) {365 \Protobuf\WireFormat::assertWireType($wire, 9);366 367 $this->name = $reader->readString($stream);368 369 continue;370 }371 372 if ($tag === 2) {373 \Protobuf\WireFormat::assertWireType($wire, 12);374 375 $this->value = $reader->readByteStream($stream);376 377 continue;378 }379 380 if ($tag === 3) {381 \Protobuf\WireFormat::assertWireType($wire, 14);382 383 $this->content_type = \attrpubapi_v1\ContentType::valueOf($reader->readVarint($stream));384 385 continue;386 }387 388 if ($tag === 4) {389 \Protobuf\WireFormat::assertWireType($wire, 11);390 391 $innerSize = $reader->readVarint($stream);392 $innerMessage = new \attrpubapi_v1\Anchor();393 394 if ($this->anchors === null) {395 $this->anchors = new \Protobuf\MessageCollection();396 }397 398 $this->anchors->add($innerMessage);399 400 $context->setLength($innerSize);401 $innerMessage->readFrom($context);402 $context->setLength($length);403 404 continue;405 }406 407 $extensions = $context->getExtensionRegistry();408 $extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;409 410 if ($extension !== null) {411 $this->extensions()->add($extension, $extension->readFrom($context, $wire));412 413 continue;414 }415 416 if ($this->unknownFieldSet === null) {417 $this->unknownFieldSet = new \Protobuf\UnknownFieldSet();418 }419 420 $data = $reader->readUnknown($stream, $wire);421 $unknown = new \Protobuf\Unknown($tag, $wire, $data);422 423 $this->unknownFieldSet->add($unknown);424 425 }426 }427 428 /**429 * {@inheritdoc}430 */431 public function serializedSize(\Protobuf\ComputeSizeContext $context)432 {433 $calculator = $context->getSizeCalculator();434 $size = 0;435 436 if ($this->name !== null) {437 $size += 1;438 $size += $calculator->computeStringSize($this->name);439 }440 441 if ($this->value !== null) {442 $size += 1;443 $size += $calculator->computeByteStreamSize($this->value);444 }445 446 if ($this->content_type !== null) {447 $size += 1;448 $size += $calculator->computeVarintSize($this->content_type->value());449 }450 451 if ($this->anchors !== null) {452 foreach ($this->anchors as $val) {453 $innerSize = $val->serializedSize($context);454 455 $size += 1;456 $size += $innerSize;457 $size += $calculator->computeVarintSize($innerSize);458 }459 }460 461 if ($this->extensions !== null) {462 $size += $this->extensions->serializedSize($context);463 }464 465 return $size;466 }467 468 /**469 * {@inheritdoc}470 */471 public function clear()472 {473 $this->name = null;474 $this->value = null;475 $this->content_type = null;476 $this->anchors = null;477 }478 479 /**480 * {@inheritdoc}481 */482 public function merge(\Protobuf\Message $message)483 {484 if ( ! $message instanceof \attrpubapi_v1\Attribute) {485 throw new \InvalidArgumentException(sprintf('Argument 1 passed to %s must be a %s, %s given', __METHOD__, __CLASS__, get_class($message)));486 }487 488 $this->name = ($message->name !== null) ? $message->name : $this->name;489 $this->value = ($message->value !== null) ? $message->value : $this->value;490 $this->content_type = ($message->content_type !== null) ? $message->content_type : $this->content_type;491 $this->anchors = ($message->anchors !== null) ? $message->anchors : $this->anchors;492 }493 494 123 495 124 } -
yoti/trunk/sdk/attrpubapi_v1/AttributeAndId.php
r1707648 r1920337 1 1 <?php 2 /** 3 * Generated by Protobuf protoc plugin. 4 * 5 * File descriptor : List.proto 6 */ 2 # Generated by the protocol buffer compiler. DO NOT EDIT! 3 # source: List.proto 7 4 5 namespace Attrpubapi_v1; 8 6 9 namespace attrpubapi_v1;7 use Google\Protobuf\Internal\GPBUtil; 10 8 11 9 /** 12 * Protobuf message : attrpubapi_v1.AttributeAndId 10 * AttributeAndId is a simple container for holding an attribute's value 11 * alongside its ID. 12 * 13 * Generated from protobuf message <code>attrpubapi_v1.AttributeAndId</code> 13 14 */ 14 class AttributeAndId extends \ Protobuf\AbstractMessage15 class AttributeAndId extends \Google\Protobuf\Internal\Message 15 16 { 17 /** 18 * Generated from protobuf field <code>.attrpubapi_v1.Attribute attribute = 1;</code> 19 */ 20 private $attribute = null; 21 /** 22 * Generated from protobuf field <code>bytes attribute_id = 2;</code> 23 */ 24 private $attribute_id = ''; 16 25 17 /** 18 * @var \Protobuf\UnknownFieldSet 19 */ 20 protected $unknownFieldSet = null; 21 22 /** 23 * @var \Protobuf\Extension\ExtensionFieldMap 24 */ 25 protected $extensions = null; 26 27 /** 28 * attribute optional message = 1 29 * 30 * @var \attrpubapi_v1\Attribute 31 */ 32 protected $attribute = null; 33 34 /** 35 * attribute_id optional bytes = 2 36 * 37 * @var \Protobuf\Stream 38 */ 39 protected $attribute_id = null; 40 41 /** 42 * Check if 'attribute' has a value 43 * 44 * @return bool 45 */ 46 public function hasAttribute() 47 { 48 return $this->attribute !== null; 26 public function __construct() { 27 \GPBMetadata\ProtoList::initOnce(); 28 parent::__construct(); 49 29 } 50 30 51 31 /** 52 * Get 'attribute' value 53 * 54 * @return \attrpubapi_v1\Attribute 32 * Generated from protobuf field <code>.attrpubapi_v1.Attribute attribute = 1;</code> 33 * @return \Attrpubapi_v1\Attribute 55 34 */ 56 35 public function getAttribute() … … 60 39 61 40 /** 62 * Set 'attribute' value63 * 64 * @ param \attrpubapi_v1\Attribute $value41 * Generated from protobuf field <code>.attrpubapi_v1.Attribute attribute = 1;</code> 42 * @param \Attrpubapi_v1\Attribute $var 43 * @return $this 65 44 */ 66 public function setAttribute( \attrpubapi_v1\Attribute $value = null)45 public function setAttribute($var) 67 46 { 68 $this->attribute = $value; 47 GPBUtil::checkMessage($var, \Attrpubapi_v1\Attribute::class); 48 $this->attribute = $var; 49 50 return $this; 69 51 } 70 52 71 53 /** 72 * Check if 'attribute_id' has a value 73 * 74 * @return bool 75 */ 76 public function hasAttributeId() 77 { 78 return $this->attribute_id !== null; 79 } 80 81 /** 82 * Get 'attribute_id' value 83 * 84 * @return \Protobuf\Stream 54 * Generated from protobuf field <code>bytes attribute_id = 2;</code> 55 * @return string 85 56 */ 86 57 public function getAttributeId() … … 90 61 91 62 /** 92 * Set 'attribute_id' value93 * 94 * @ param \Protobuf\Stream $value63 * Generated from protobuf field <code>bytes attribute_id = 2;</code> 64 * @param string $var 65 * @return $this 95 66 */ 96 public function setAttributeId($va lue = null)67 public function setAttributeId($var) 97 68 { 98 if ($value !== null && ! $value instanceof \Protobuf\Stream) { 99 $value = \Protobuf\Stream::wrap($value); 100 } 69 GPBUtil::checkString($var, False); 70 $this->attribute_id = $var; 101 71 102 $this->attribute_id = $value;72 return $this; 103 73 } 104 105 /**106 * {@inheritdoc}107 */108 public function extensions()109 {110 if ( $this->extensions !== null) {111 return $this->extensions;112 }113 114 return $this->extensions = new \Protobuf\Extension\ExtensionFieldMap(__CLASS__);115 }116 117 /**118 * {@inheritdoc}119 */120 public function unknownFieldSet()121 {122 return $this->unknownFieldSet;123 }124 125 /**126 * {@inheritdoc}127 */128 public static function fromStream($stream, \Protobuf\Configuration $configuration = null)129 {130 return new self($stream, $configuration);131 }132 133 /**134 * {@inheritdoc}135 */136 public static function fromArray(array $values)137 {138 $message = new self();139 $values = array_merge([140 'attribute' => null,141 'attribute_id' => null142 ], $values);143 144 $message->setAttribute($values['attribute']);145 $message->setAttributeId($values['attribute_id']);146 147 return $message;148 }149 150 /**151 * {@inheritdoc}152 */153 public static function descriptor()154 {155 return \google\protobuf\DescriptorProto::fromArray([156 'name' => 'AttributeAndId',157 'field' => [158 \google\protobuf\FieldDescriptorProto::fromArray([159 'number' => 1,160 'name' => 'attribute',161 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_MESSAGE(),162 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL(),163 'type_name' => '.attrpubapi_v1.Attribute'164 ]),165 \google\protobuf\FieldDescriptorProto::fromArray([166 'number' => 2,167 'name' => 'attribute_id',168 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_BYTES(),169 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()170 ]),171 ],172 ]);173 }174 175 /**176 * {@inheritdoc}177 */178 public function toStream(\Protobuf\Configuration $configuration = null)179 {180 $config = $configuration ?: \Protobuf\Configuration::getInstance();181 $context = $config->createWriteContext();182 $stream = $context->getStream();183 184 $this->writeTo($context);185 $stream->seek(0);186 187 return $stream;188 }189 190 /**191 * {@inheritdoc}192 */193 public function writeTo(\Protobuf\WriteContext $context)194 {195 $stream = $context->getStream();196 $writer = $context->getWriter();197 $sizeContext = $context->getComputeSizeContext();198 199 if ($this->attribute !== null) {200 $writer->writeVarint($stream, 10);201 $writer->writeVarint($stream, $this->attribute->serializedSize($sizeContext));202 $this->attribute->writeTo($context);203 }204 205 if ($this->attribute_id !== null) {206 $writer->writeVarint($stream, 18);207 $writer->writeByteStream($stream, $this->attribute_id);208 }209 210 if ($this->extensions !== null) {211 $this->extensions->writeTo($context);212 }213 214 return $stream;215 }216 217 /**218 * {@inheritdoc}219 */220 public function readFrom(\Protobuf\ReadContext $context)221 {222 $reader = $context->getReader();223 $length = $context->getLength();224 $stream = $context->getStream();225 226 $limit = ($length !== null)227 ? ($stream->tell() + $length)228 : null;229 230 while ($limit === null || $stream->tell() < $limit) {231 232 if ($stream->eof()) {233 break;234 }235 236 $key = $reader->readVarint($stream);237 $wire = \Protobuf\WireFormat::getTagWireType($key);238 $tag = \Protobuf\WireFormat::getTagFieldNumber($key);239 240 if ($stream->eof()) {241 break;242 }243 244 if ($tag === 1) {245 \Protobuf\WireFormat::assertWireType($wire, 11);246 247 $innerSize = $reader->readVarint($stream);248 $innerMessage = new \attrpubapi_v1\Attribute();249 250 $this->attribute = $innerMessage;251 252 $context->setLength($innerSize);253 $innerMessage->readFrom($context);254 $context->setLength($length);255 256 continue;257 }258 259 if ($tag === 2) {260 \Protobuf\WireFormat::assertWireType($wire, 12);261 262 $this->attribute_id = $reader->readByteStream($stream);263 264 continue;265 }266 267 $extensions = $context->getExtensionRegistry();268 $extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;269 270 if ($extension !== null) {271 $this->extensions()->add($extension, $extension->readFrom($context, $wire));272 273 continue;274 }275 276 if ($this->unknownFieldSet === null) {277 $this->unknownFieldSet = new \Protobuf\UnknownFieldSet();278 }279 280 $data = $reader->readUnknown($stream, $wire);281 $unknown = new \Protobuf\Unknown($tag, $wire, $data);282 283 $this->unknownFieldSet->add($unknown);284 285 }286 }287 288 /**289 * {@inheritdoc}290 */291 public function serializedSize(\Protobuf\ComputeSizeContext $context)292 {293 $calculator = $context->getSizeCalculator();294 $size = 0;295 296 if ($this->attribute !== null) {297 $innerSize = $this->attribute->serializedSize($context);298 299 $size += 1;300 $size += $innerSize;301 $size += $calculator->computeVarintSize($innerSize);302 }303 304 if ($this->attribute_id !== null) {305 $size += 1;306 $size += $calculator->computeByteStreamSize($this->attribute_id);307 }308 309 if ($this->extensions !== null) {310 $size += $this->extensions->serializedSize($context);311 }312 313 return $size;314 }315 316 /**317 * {@inheritdoc}318 */319 public function clear()320 {321 $this->attribute = null;322 $this->attribute_id = null;323 }324 325 /**326 * {@inheritdoc}327 */328 public function merge(\Protobuf\Message $message)329 {330 if ( ! $message instanceof \attrpubapi_v1\AttributeAndId) {331 throw new \InvalidArgumentException(sprintf('Argument 1 passed to %s must be a %s, %s given', __METHOD__, __CLASS__, get_class($message)));332 }333 334 $this->attribute = ($message->attribute !== null) ? $message->attribute : $this->attribute;335 $this->attribute_id = ($message->attribute_id !== null) ? $message->attribute_id : $this->attribute_id;336 }337 338 74 339 75 } -
yoti/trunk/sdk/attrpubapi_v1/AttributeAndIdList.php
r1707648 r1920337 1 1 <?php 2 /** 3 * Generated by Protobuf protoc plugin. 4 * 5 * File descriptor : List.proto 6 */ 2 # Generated by the protocol buffer compiler. DO NOT EDIT! 3 # source: List.proto 7 4 5 namespace Attrpubapi_v1; 8 6 9 namespace attrpubapi_v1;7 use Google\Protobuf\Internal\GPBUtil; 10 8 11 9 /** 12 * Protobuf message : attrpubapi_v1.AttributeAndIdList10 * Generated from protobuf message <code>attrpubapi_v1.AttributeAndIdList</code> 13 11 */ 14 class AttributeAndIdList extends \ Protobuf\AbstractMessage12 class AttributeAndIdList extends \Google\Protobuf\Internal\Message 15 13 { 14 /** 15 * Generated from protobuf field <code>repeated .attrpubapi_v1.AttributeAndId attribute_and_id_list = 1;</code> 16 */ 17 private $attribute_and_id_list; 16 18 17 /** 18 * @var \Protobuf\UnknownFieldSet 19 */ 20 protected $unknownFieldSet = null; 21 22 /** 23 * @var \Protobuf\Extension\ExtensionFieldMap 24 */ 25 protected $extensions = null; 26 27 /** 28 * attribute_and_id_list repeated message = 1 29 * 30 * @var \Protobuf\Collection<\attrpubapi_v1\AttributeAndId> 31 */ 32 protected $attribute_and_id_list = null; 33 34 /** 35 * Check if 'attribute_and_id_list' has a value 36 * 37 * @return bool 38 */ 39 public function hasAttributeAndIdListList() 40 { 41 return $this->attribute_and_id_list !== null; 19 public function __construct() { 20 \GPBMetadata\ProtoList::initOnce(); 21 parent::__construct(); 42 22 } 43 23 44 24 /** 45 * Get 'attribute_and_id_list' value 46 * 47 * @return \Protobuf\Collection<\attrpubapi_v1\AttributeAndId> 25 * Generated from protobuf field <code>repeated .attrpubapi_v1.AttributeAndId attribute_and_id_list = 1;</code> 26 * @return \Google\Protobuf\Internal\RepeatedField 48 27 */ 49 public function getAttributeAndIdList List()28 public function getAttributeAndIdList() 50 29 { 51 30 return $this->attribute_and_id_list; … … 53 32 54 33 /** 55 * Set 'attribute_and_id_list' value56 * 57 * @ param \Protobuf\Collection<\attrpubapi_v1\AttributeAndId> $value34 * Generated from protobuf field <code>repeated .attrpubapi_v1.AttributeAndId attribute_and_id_list = 1;</code> 35 * @param \Attrpubapi_v1\AttributeAndId[]|\Google\Protobuf\Internal\RepeatedField $var 36 * @return $this 58 37 */ 59 public function setAttributeAndIdList List(\Protobuf\Collection $value = null)38 public function setAttributeAndIdList($var) 60 39 { 61 $this->attribute_and_id_list = $value; 40 $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Attrpubapi_v1\AttributeAndId::class); 41 $this->attribute_and_id_list = $arr; 42 43 return $this; 62 44 } 63 64 /**65 * Add a new element to 'attribute_and_id_list'66 *67 * @param \attrpubapi_v1\AttributeAndId $value68 */69 public function addAttributeAndIdList(\attrpubapi_v1\AttributeAndId $value)70 {71 if ($this->attribute_and_id_list === null) {72 $this->attribute_and_id_list = new \Protobuf\MessageCollection();73 }74 75 $this->attribute_and_id_list->add($value);76 }77 78 /**79 * {@inheritdoc}80 */81 public function extensions()82 {83 if ( $this->extensions !== null) {84 return $this->extensions;85 }86 87 return $this->extensions = new \Protobuf\Extension\ExtensionFieldMap(__CLASS__);88 }89 90 /**91 * {@inheritdoc}92 */93 public function unknownFieldSet()94 {95 return $this->unknownFieldSet;96 }97 98 /**99 * {@inheritdoc}100 */101 public static function fromStream($stream, \Protobuf\Configuration $configuration = null)102 {103 return new self($stream, $configuration);104 }105 106 /**107 * {@inheritdoc}108 */109 public static function fromArray(array $values)110 {111 $message = new self();112 $values = array_merge([113 'attribute_and_id_list' => []114 ], $values);115 116 foreach ($values['attribute_and_id_list'] as $item) {117 $message->addAttributeAndIdList($item);118 }119 120 return $message;121 }122 123 /**124 * {@inheritdoc}125 */126 public static function descriptor()127 {128 return \google\protobuf\DescriptorProto::fromArray([129 'name' => 'AttributeAndIdList',130 'field' => [131 \google\protobuf\FieldDescriptorProto::fromArray([132 'number' => 1,133 'name' => 'attribute_and_id_list',134 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_MESSAGE(),135 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_REPEATED(),136 'type_name' => '.attrpubapi_v1.AttributeAndId'137 ]),138 ],139 ]);140 }141 142 /**143 * {@inheritdoc}144 */145 public function toStream(\Protobuf\Configuration $configuration = null)146 {147 $config = $configuration ?: \Protobuf\Configuration::getInstance();148 $context = $config->createWriteContext();149 $stream = $context->getStream();150 151 $this->writeTo($context);152 $stream->seek(0);153 154 return $stream;155 }156 157 /**158 * {@inheritdoc}159 */160 public function writeTo(\Protobuf\WriteContext $context)161 {162 $stream = $context->getStream();163 $writer = $context->getWriter();164 $sizeContext = $context->getComputeSizeContext();165 166 if ($this->attribute_and_id_list !== null) {167 foreach ($this->attribute_and_id_list as $val) {168 $writer->writeVarint($stream, 10);169 $writer->writeVarint($stream, $val->serializedSize($sizeContext));170 $val->writeTo($context);171 }172 }173 174 if ($this->extensions !== null) {175 $this->extensions->writeTo($context);176 }177 178 return $stream;179 }180 181 /**182 * {@inheritdoc}183 */184 public function readFrom(\Protobuf\ReadContext $context)185 {186 $reader = $context->getReader();187 $length = $context->getLength();188 $stream = $context->getStream();189 190 $limit = ($length !== null)191 ? ($stream->tell() + $length)192 : null;193 194 while ($limit === null || $stream->tell() < $limit) {195 196 if ($stream->eof()) {197 break;198 }199 200 $key = $reader->readVarint($stream);201 $wire = \Protobuf\WireFormat::getTagWireType($key);202 $tag = \Protobuf\WireFormat::getTagFieldNumber($key);203 204 if ($stream->eof()) {205 break;206 }207 208 if ($tag === 1) {209 \Protobuf\WireFormat::assertWireType($wire, 11);210 211 $innerSize = $reader->readVarint($stream);212 $innerMessage = new \attrpubapi_v1\AttributeAndId();213 214 if ($this->attribute_and_id_list === null) {215 $this->attribute_and_id_list = new \Protobuf\MessageCollection();216 }217 218 $this->attribute_and_id_list->add($innerMessage);219 220 $context->setLength($innerSize);221 $innerMessage->readFrom($context);222 $context->setLength($length);223 224 continue;225 }226 227 $extensions = $context->getExtensionRegistry();228 $extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;229 230 if ($extension !== null) {231 $this->extensions()->add($extension, $extension->readFrom($context, $wire));232 233 continue;234 }235 236 if ($this->unknownFieldSet === null) {237 $this->unknownFieldSet = new \Protobuf\UnknownFieldSet();238 }239 240 $data = $reader->readUnknown($stream, $wire);241 $unknown = new \Protobuf\Unknown($tag, $wire, $data);242 243 $this->unknownFieldSet->add($unknown);244 245 }246 }247 248 /**249 * {@inheritdoc}250 */251 public function serializedSize(\Protobuf\ComputeSizeContext $context)252 {253 $calculator = $context->getSizeCalculator();254 $size = 0;255 256 if ($this->attribute_and_id_list !== null) {257 foreach ($this->attribute_and_id_list as $val) {258 $innerSize = $val->serializedSize($context);259 260 $size += 1;261 $size += $innerSize;262 $size += $calculator->computeVarintSize($innerSize);263 }264 }265 266 if ($this->extensions !== null) {267 $size += $this->extensions->serializedSize($context);268 }269 270 return $size;271 }272 273 /**274 * {@inheritdoc}275 */276 public function clear()277 {278 $this->attribute_and_id_list = null;279 }280 281 /**282 * {@inheritdoc}283 */284 public function merge(\Protobuf\Message $message)285 {286 if ( ! $message instanceof \attrpubapi_v1\AttributeAndIdList) {287 throw new \InvalidArgumentException(sprintf('Argument 1 passed to %s must be a %s, %s given', __METHOD__, __CLASS__, get_class($message)));288 }289 290 $this->attribute_and_id_list = ($message->attribute_and_id_list !== null) ? $message->attribute_and_id_list : $this->attribute_and_id_list;291 }292 293 45 294 46 } -
yoti/trunk/sdk/attrpubapi_v1/AttributeList.php
r1707648 r1920337 1 1 <?php 2 /** 3 * Generated by Protobuf protoc plugin. 4 * 5 * File descriptor : List.proto 6 */ 2 # Generated by the protocol buffer compiler. DO NOT EDIT! 3 # source: List.proto 7 4 5 namespace Attrpubapi_v1; 8 6 9 namespace attrpubapi_v1;7 use Google\Protobuf\Internal\GPBUtil; 10 8 11 9 /** 12 * Protobuf message : attrpubapi_v1.AttributeList10 * Generated from protobuf message <code>attrpubapi_v1.AttributeList</code> 13 11 */ 14 class AttributeList extends \ Protobuf\AbstractMessage12 class AttributeList extends \Google\Protobuf\Internal\Message 15 13 { 14 /** 15 * Generated from protobuf field <code>repeated .attrpubapi_v1.Attribute attributes = 1;</code> 16 */ 17 private $attributes; 16 18 17 /** 18 * @var \Protobuf\UnknownFieldSet 19 */ 20 protected $unknownFieldSet = null; 21 22 /** 23 * @var \Protobuf\Extension\ExtensionFieldMap 24 */ 25 protected $extensions = null; 26 27 /** 28 * attributes repeated message = 1 29 * 30 * @var \Protobuf\Collection<\attrpubapi_v1\Attribute> 31 */ 32 protected $attributes = null; 33 34 /** 35 * Check if 'attributes' has a value 36 * 37 * @return bool 38 */ 39 public function hasAttributesList() 40 { 41 return $this->attributes !== null; 19 public function __construct() { 20 \GPBMetadata\ProtoList::initOnce(); 21 parent::__construct(); 42 22 } 43 23 44 24 /** 45 * Get 'attributes' value 46 * 47 * @return \Protobuf\Collection<\attrpubapi_v1\Attribute> 25 * Generated from protobuf field <code>repeated .attrpubapi_v1.Attribute attributes = 1;</code> 26 * @return \Google\Protobuf\Internal\RepeatedField 48 27 */ 49 public function getAttributes List()28 public function getAttributes() 50 29 { 51 30 return $this->attributes; … … 53 32 54 33 /** 55 * Set 'attributes' value56 * 57 * @ param \Protobuf\Collection<\attrpubapi_v1\Attribute> $value34 * Generated from protobuf field <code>repeated .attrpubapi_v1.Attribute attributes = 1;</code> 35 * @param \Attrpubapi_v1\Attribute[]|\Google\Protobuf\Internal\RepeatedField $var 36 * @return $this 58 37 */ 59 public function setAttributes List(\Protobuf\Collection $value = null)38 public function setAttributes($var) 60 39 { 61 $this->attributes = $value; 40 $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Attrpubapi_v1\Attribute::class); 41 $this->attributes = $arr; 42 43 return $this; 62 44 } 63 64 /**65 * Add a new element to 'attributes'66 *67 * @param \attrpubapi_v1\Attribute $value68 */69 public function addAttributes(\attrpubapi_v1\Attribute $value)70 {71 if ($this->attributes === null) {72 $this->attributes = new \Protobuf\MessageCollection();73 }74 75 $this->attributes->add($value);76 }77 78 /**79 * {@inheritdoc}80 */81 public function extensions()82 {83 if ( $this->extensions !== null) {84 return $this->extensions;85 }86 87 return $this->extensions = new \Protobuf\Extension\ExtensionFieldMap(__CLASS__);88 }89 90 /**91 * {@inheritdoc}92 */93 public function unknownFieldSet()94 {95 return $this->unknownFieldSet;96 }97 98 /**99 * {@inheritdoc}100 */101 public static function fromStream($stream, \Protobuf\Configuration $configuration = null)102 {103 return new self($stream, $configuration);104 }105 106 /**107 * {@inheritdoc}108 */109 public static function fromArray(array $values)110 {111 $message = new self();112 $values = array_merge([113 'attributes' => []114 ], $values);115 116 foreach ($values['attributes'] as $item) {117 $message->addAttributes($item);118 }119 120 return $message;121 }122 123 /**124 * {@inheritdoc}125 */126 public static function descriptor()127 {128 return \google\protobuf\DescriptorProto::fromArray([129 'name' => 'AttributeList',130 'field' => [131 \google\protobuf\FieldDescriptorProto::fromArray([132 'number' => 1,133 'name' => 'attributes',134 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_MESSAGE(),135 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_REPEATED(),136 'type_name' => '.attrpubapi_v1.Attribute'137 ]),138 ],139 ]);140 }141 142 /**143 * {@inheritdoc}144 */145 public function toStream(\Protobuf\Configuration $configuration = null)146 {147 $config = $configuration ?: \Protobuf\Configuration::getInstance();148 $context = $config->createWriteContext();149 $stream = $context->getStream();150 151 $this->writeTo($context);152 $stream->seek(0);153 154 return $stream;155 }156 157 /**158 * {@inheritdoc}159 */160 public function writeTo(\Protobuf\WriteContext $context)161 {162 $stream = $context->getStream();163 $writer = $context->getWriter();164 $sizeContext = $context->getComputeSizeContext();165 166 if ($this->attributes !== null) {167 foreach ($this->attributes as $val) {168 $writer->writeVarint($stream, 10);169 $writer->writeVarint($stream, $val->serializedSize($sizeContext));170 $val->writeTo($context);171 }172 }173 174 if ($this->extensions !== null) {175 $this->extensions->writeTo($context);176 }177 178 return $stream;179 }180 181 /**182 * {@inheritdoc}183 */184 public function readFrom(\Protobuf\ReadContext $context)185 {186 $reader = $context->getReader();187 $length = $context->getLength();188 $stream = $context->getStream();189 190 $limit = ($length !== null)191 ? ($stream->tell() + $length)192 : null;193 194 while ($limit === null || $stream->tell() < $limit) {195 196 if ($stream->eof()) {197 break;198 }199 200 $key = $reader->readVarint($stream);201 $wire = \Protobuf\WireFormat::getTagWireType($key);202 $tag = \Protobuf\WireFormat::getTagFieldNumber($key);203 204 if ($stream->eof()) {205 break;206 }207 208 if ($tag === 1) {209 \Protobuf\WireFormat::assertWireType($wire, 11);210 211 $innerSize = $reader->readVarint($stream);212 $innerMessage = new \attrpubapi_v1\Attribute();213 214 if ($this->attributes === null) {215 $this->attributes = new \Protobuf\MessageCollection();216 }217 218 $this->attributes->add($innerMessage);219 220 $context->setLength($innerSize);221 $innerMessage->readFrom($context);222 $context->setLength($length);223 224 continue;225 }226 227 $extensions = $context->getExtensionRegistry();228 $extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;229 230 if ($extension !== null) {231 $this->extensions()->add($extension, $extension->readFrom($context, $wire));232 233 continue;234 }235 236 if ($this->unknownFieldSet === null) {237 $this->unknownFieldSet = new \Protobuf\UnknownFieldSet();238 }239 240 $data = $reader->readUnknown($stream, $wire);241 $unknown = new \Protobuf\Unknown($tag, $wire, $data);242 243 $this->unknownFieldSet->add($unknown);244 245 }246 }247 248 /**249 * {@inheritdoc}250 */251 public function serializedSize(\Protobuf\ComputeSizeContext $context)252 {253 $calculator = $context->getSizeCalculator();254 $size = 0;255 256 if ($this->attributes !== null) {257 foreach ($this->attributes as $val) {258 $innerSize = $val->serializedSize($context);259 260 $size += 1;261 $size += $innerSize;262 $size += $calculator->computeVarintSize($innerSize);263 }264 }265 266 if ($this->extensions !== null) {267 $size += $this->extensions->serializedSize($context);268 }269 270 return $size;271 }272 273 /**274 * {@inheritdoc}275 */276 public function clear()277 {278 $this->attributes = null;279 }280 281 /**282 * {@inheritdoc}283 */284 public function merge(\Protobuf\Message $message)285 {286 if ( ! $message instanceof \attrpubapi_v1\AttributeList) {287 throw new \InvalidArgumentException(sprintf('Argument 1 passed to %s must be a %s, %s given', __METHOD__, __CLASS__, get_class($message)));288 }289 290 $this->attributes = ($message->attributes !== null) ? $message->attributes : $this->attributes;291 }292 293 45 294 46 } -
yoti/trunk/sdk/attrpubapi_v1/AttributeSigning.php
r1707648 r1920337 1 1 <?php 2 /** 3 * Generated by Protobuf protoc plugin. 4 * 5 * File descriptor : Signing.proto 6 */ 2 # Generated by the protocol buffer compiler. DO NOT EDIT! 3 # source: Signing.proto 7 4 5 namespace Attrpubapi_v1; 8 6 9 namespace attrpubapi_v1;7 use Google\Protobuf\Internal\GPBUtil; 10 8 11 9 /** 12 * Protobuf message : attrpubapi_v1.AttributeSigning10 * Generated from protobuf message <code>attrpubapi_v1.AttributeSigning</code> 13 11 */ 14 class AttributeSigning extends \ Protobuf\AbstractMessage12 class AttributeSigning extends \Google\Protobuf\Internal\Message 15 13 { 14 /** 15 * Generated from protobuf field <code>string name = 1;</code> 16 */ 17 private $name = ''; 18 /** 19 * Generated from protobuf field <code>bytes value = 2;</code> 20 */ 21 private $value = ''; 22 /** 23 * Generated from protobuf field <code>.attrpubapi_v1.ContentType content_type = 3;</code> 24 */ 25 private $content_type = 0; 26 /** 27 * Generated from protobuf field <code>bytes artifact_signature = 4;</code> 28 */ 29 private $artifact_signature = ''; 30 /** 31 * Generated from protobuf field <code>string sub_type = 5;</code> 32 */ 33 private $sub_type = ''; 34 /** 35 * Generated from protobuf field <code>bytes signed_time_stamp = 6;</code> 36 */ 37 private $signed_time_stamp = ''; 16 38 17 /** 18 * @var \Protobuf\UnknownFieldSet 19 */ 20 protected $unknownFieldSet = null; 21 22 /** 23 * @var \Protobuf\Extension\ExtensionFieldMap 24 */ 25 protected $extensions = null; 26 27 /** 28 * name optional string = 1 29 * 30 * @var string 31 */ 32 protected $name = null; 33 34 /** 35 * value optional bytes = 2 36 * 37 * @var \Protobuf\Stream 38 */ 39 protected $value = null; 40 41 /** 42 * content_type optional enum = 3 43 * 44 * @var \attrpubapi_v1\ContentType 45 */ 46 protected $content_type = null; 47 48 /** 49 * artifact_signature optional bytes = 4 50 * 51 * @var \Protobuf\Stream 52 */ 53 protected $artifact_signature = null; 54 55 /** 56 * sub_type optional string = 5 57 * 58 * @var string 59 */ 60 protected $sub_type = null; 61 62 /** 63 * signed_time_stamp optional bytes = 6 64 * 65 * @var \Protobuf\Stream 66 */ 67 protected $signed_time_stamp = null; 68 69 /** 70 * Check if 'name' has a value 71 * 72 * @return bool 73 */ 74 public function hasName() 75 { 76 return $this->name !== null; 39 public function __construct() { 40 \GPBMetadata\Signing::initOnce(); 41 parent::__construct(); 77 42 } 78 43 79 44 /** 80 * Get 'name' value 81 * 45 * Generated from protobuf field <code>string name = 1;</code> 82 46 * @return string 83 47 */ … … 88 52 89 53 /** 90 * Set 'name' value91 * 92 * @ param string $value54 * Generated from protobuf field <code>string name = 1;</code> 55 * @param string $var 56 * @return $this 93 57 */ 94 public function setName($va lue = null)58 public function setName($var) 95 59 { 96 $this->name = $value; 60 GPBUtil::checkString($var, True); 61 $this->name = $var; 62 63 return $this; 97 64 } 98 65 99 66 /** 100 * Check if 'value' has a value 101 * 102 * @return bool 103 */ 104 public function hasValue() 105 { 106 return $this->value !== null; 107 } 108 109 /** 110 * Get 'value' value 111 * 112 * @return \Protobuf\Stream 67 * Generated from protobuf field <code>bytes value = 2;</code> 68 * @return string 113 69 */ 114 70 public function getValue() … … 118 74 119 75 /** 120 * Set 'value' value121 * 122 * @ param \Protobuf\Stream $value76 * Generated from protobuf field <code>bytes value = 2;</code> 77 * @param string $var 78 * @return $this 123 79 */ 124 public function setValue($va lue = null)80 public function setValue($var) 125 81 { 126 if ($value !== null && ! $value instanceof \Protobuf\Stream) { 127 $value = \Protobuf\Stream::wrap($value); 128 } 82 GPBUtil::checkString($var, False); 83 $this->value = $var; 129 84 130 $this->value = $value;85 return $this; 131 86 } 132 87 133 88 /** 134 * Check if 'content_type' has a value 135 * 136 * @return bool 137 */ 138 public function hasContentType() 139 { 140 return $this->content_type !== null; 141 } 142 143 /** 144 * Get 'content_type' value 145 * 146 * @return \attrpubapi_v1\ContentType 89 * Generated from protobuf field <code>.attrpubapi_v1.ContentType content_type = 3;</code> 90 * @return int 147 91 */ 148 92 public function getContentType() … … 152 96 153 97 /** 154 * Set 'content_type' value155 * 156 * @ param \attrpubapi_v1\ContentType $value98 * Generated from protobuf field <code>.attrpubapi_v1.ContentType content_type = 3;</code> 99 * @param int $var 100 * @return $this 157 101 */ 158 public function setContentType( \attrpubapi_v1\ContentType $value = null)102 public function setContentType($var) 159 103 { 160 $this->content_type = $value; 104 GPBUtil::checkEnum($var, \Attrpubapi_v1\ContentType::class); 105 $this->content_type = $var; 106 107 return $this; 161 108 } 162 109 163 110 /** 164 * Check if 'artifact_signature' has a value 165 * 166 * @return bool 167 */ 168 public function hasArtifactSignature() 169 { 170 return $this->artifact_signature !== null; 171 } 172 173 /** 174 * Get 'artifact_signature' value 175 * 176 * @return \Protobuf\Stream 111 * Generated from protobuf field <code>bytes artifact_signature = 4;</code> 112 * @return string 177 113 */ 178 114 public function getArtifactSignature() … … 182 118 183 119 /** 184 * Set 'artifact_signature' value185 * 186 * @ param \Protobuf\Stream $value120 * Generated from protobuf field <code>bytes artifact_signature = 4;</code> 121 * @param string $var 122 * @return $this 187 123 */ 188 public function setArtifactSignature($va lue = null)124 public function setArtifactSignature($var) 189 125 { 190 if ($value !== null && ! $value instanceof \Protobuf\Stream) { 191 $value = \Protobuf\Stream::wrap($value); 192 } 126 GPBUtil::checkString($var, False); 127 $this->artifact_signature = $var; 193 128 194 $this->artifact_signature = $value;129 return $this; 195 130 } 196 131 197 132 /** 198 * Check if 'sub_type' has a value 199 * 200 * @return bool 201 */ 202 public function hasSubType() 203 { 204 return $this->sub_type !== null; 205 } 206 207 /** 208 * Get 'sub_type' value 209 * 133 * Generated from protobuf field <code>string sub_type = 5;</code> 210 134 * @return string 211 135 */ … … 216 140 217 141 /** 218 * Set 'sub_type' value219 * 220 * @ param string $value142 * Generated from protobuf field <code>string sub_type = 5;</code> 143 * @param string $var 144 * @return $this 221 145 */ 222 public function setSubType($va lue = null)146 public function setSubType($var) 223 147 { 224 $this->sub_type = $value; 148 GPBUtil::checkString($var, True); 149 $this->sub_type = $var; 150 151 return $this; 225 152 } 226 153 227 154 /** 228 * Check if 'signed_time_stamp' has a value 229 * 230 * @return bool 231 */ 232 public function hasSignedTimeStamp() 233 { 234 return $this->signed_time_stamp !== null; 235 } 236 237 /** 238 * Get 'signed_time_stamp' value 239 * 240 * @return \Protobuf\Stream 155 * Generated from protobuf field <code>bytes signed_time_stamp = 6;</code> 156 * @return string 241 157 */ 242 158 public function getSignedTimeStamp() … … 246 162 247 163 /** 248 * Set 'signed_time_stamp' value249 * 250 * @ param \Protobuf\Stream $value164 * Generated from protobuf field <code>bytes signed_time_stamp = 6;</code> 165 * @param string $var 166 * @return $this 251 167 */ 252 public function setSignedTimeStamp($va lue = null)168 public function setSignedTimeStamp($var) 253 169 { 254 if ($value !== null && ! $value instanceof \Protobuf\Stream) { 255 $value = \Protobuf\Stream::wrap($value); 256 } 170 GPBUtil::checkString($var, False); 171 $this->signed_time_stamp = $var; 257 172 258 $this->signed_time_stamp = $value;173 return $this; 259 174 } 260 261 /**262 * {@inheritdoc}263 */264 public function extensions()265 {266 if ( $this->extensions !== null) {267 return $this->extensions;268 }269 270 return $this->extensions = new \Protobuf\Extension\ExtensionFieldMap(__CLASS__);271 }272 273 /**274 * {@inheritdoc}275 */276 public function unknownFieldSet()277 {278 return $this->unknownFieldSet;279 }280 281 /**282 * {@inheritdoc}283 */284 public static function fromStream($stream, \Protobuf\Configuration $configuration = null)285 {286 return new self($stream, $configuration);287 }288 289 /**290 * {@inheritdoc}291 */292 public static function fromArray(array $values)293 {294 $message = new self();295 $values = array_merge([296 'name' => null,297 'value' => null,298 'content_type' => null,299 'artifact_signature' => null,300 'sub_type' => null,301 'signed_time_stamp' => null302 ], $values);303 304 $message->setName($values['name']);305 $message->setValue($values['value']);306 $message->setContentType($values['content_type']);307 $message->setArtifactSignature($values['artifact_signature']);308 $message->setSubType($values['sub_type']);309 $message->setSignedTimeStamp($values['signed_time_stamp']);310 311 return $message;312 }313 314 /**315 * {@inheritdoc}316 */317 public static function descriptor()318 {319 return \google\protobuf\DescriptorProto::fromArray([320 'name' => 'AttributeSigning',321 'field' => [322 \google\protobuf\FieldDescriptorProto::fromArray([323 'number' => 1,324 'name' => 'name',325 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_STRING(),326 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()327 ]),328 \google\protobuf\FieldDescriptorProto::fromArray([329 'number' => 2,330 'name' => 'value',331 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_BYTES(),332 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()333 ]),334 \google\protobuf\FieldDescriptorProto::fromArray([335 'number' => 3,336 'name' => 'content_type',337 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_ENUM(),338 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL(),339 'type_name' => '.attrpubapi_v1.ContentType'340 ]),341 \google\protobuf\FieldDescriptorProto::fromArray([342 'number' => 4,343 'name' => 'artifact_signature',344 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_BYTES(),345 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()346 ]),347 \google\protobuf\FieldDescriptorProto::fromArray([348 'number' => 5,349 'name' => 'sub_type',350 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_STRING(),351 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()352 ]),353 \google\protobuf\FieldDescriptorProto::fromArray([354 'number' => 6,355 'name' => 'signed_time_stamp',356 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_BYTES(),357 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()358 ]),359 ],360 ]);361 }362 363 /**364 * {@inheritdoc}365 */366 public function toStream(\Protobuf\Configuration $configuration = null)367 {368 $config = $configuration ?: \Protobuf\Configuration::getInstance();369 $context = $config->createWriteContext();370 $stream = $context->getStream();371 372 $this->writeTo($context);373 $stream->seek(0);374 375 return $stream;376 }377 378 /**379 * {@inheritdoc}380 */381 public function writeTo(\Protobuf\WriteContext $context)382 {383 $stream = $context->getStream();384 $writer = $context->getWriter();385 $sizeContext = $context->getComputeSizeContext();386 387 if ($this->name !== null) {388 $writer->writeVarint($stream, 10);389 $writer->writeString($stream, $this->name);390 }391 392 if ($this->value !== null) {393 $writer->writeVarint($stream, 18);394 $writer->writeByteStream($stream, $this->value);395 }396 397 if ($this->content_type !== null) {398 $writer->writeVarint($stream, 24);399 $writer->writeVarint($stream, $this->content_type->value());400 }401 402 if ($this->artifact_signature !== null) {403 $writer->writeVarint($stream, 34);404 $writer->writeByteStream($stream, $this->artifact_signature);405 }406 407 if ($this->sub_type !== null) {408 $writer->writeVarint($stream, 42);409 $writer->writeString($stream, $this->sub_type);410 }411 412 if ($this->signed_time_stamp !== null) {413 $writer->writeVarint($stream, 50);414 $writer->writeByteStream($stream, $this->signed_time_stamp);415 }416 417 if ($this->extensions !== null) {418 $this->extensions->writeTo($context);419 }420 421 return $stream;422 }423 424 /**425 * {@inheritdoc}426 */427 public function readFrom(\Protobuf\ReadContext $context)428 {429 $reader = $context->getReader();430 $length = $context->getLength();431 $stream = $context->getStream();432 433 $limit = ($length !== null)434 ? ($stream->tell() + $length)435 : null;436 437 while ($limit === null || $stream->tell() < $limit) {438 439 if ($stream->eof()) {440 break;441 }442 443 $key = $reader->readVarint($stream);444 $wire = \Protobuf\WireFormat::getTagWireType($key);445 $tag = \Protobuf\WireFormat::getTagFieldNumber($key);446 447 if ($stream->eof()) {448 break;449 }450 451 if ($tag === 1) {452 \Protobuf\WireFormat::assertWireType($wire, 9);453 454 $this->name = $reader->readString($stream);455 456 continue;457 }458 459 if ($tag === 2) {460 \Protobuf\WireFormat::assertWireType($wire, 12);461 462 $this->value = $reader->readByteStream($stream);463 464 continue;465 }466 467 if ($tag === 3) {468 \Protobuf\WireFormat::assertWireType($wire, 14);469 470 $this->content_type = \attrpubapi_v1\ContentType::valueOf($reader->readVarint($stream));471 472 continue;473 }474 475 if ($tag === 4) {476 \Protobuf\WireFormat::assertWireType($wire, 12);477 478 $this->artifact_signature = $reader->readByteStream($stream);479 480 continue;481 }482 483 if ($tag === 5) {484 \Protobuf\WireFormat::assertWireType($wire, 9);485 486 $this->sub_type = $reader->readString($stream);487 488 continue;489 }490 491 if ($tag === 6) {492 \Protobuf\WireFormat::assertWireType($wire, 12);493 494 $this->signed_time_stamp = $reader->readByteStream($stream);495 496 continue;497 }498 499 $extensions = $context->getExtensionRegistry();500 $extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;501 502 if ($extension !== null) {503 $this->extensions()->add($extension, $extension->readFrom($context, $wire));504 505 continue;506 }507 508 if ($this->unknownFieldSet === null) {509 $this->unknownFieldSet = new \Protobuf\UnknownFieldSet();510 }511 512 $data = $reader->readUnknown($stream, $wire);513 $unknown = new \Protobuf\Unknown($tag, $wire, $data);514 515 $this->unknownFieldSet->add($unknown);516 517 }518 }519 520 /**521 * {@inheritdoc}522 */523 public function serializedSize(\Protobuf\ComputeSizeContext $context)524 {525 $calculator = $context->getSizeCalculator();526 $size = 0;527 528 if ($this->name !== null) {529 $size += 1;530 $size += $calculator->computeStringSize($this->name);531 }532 533 if ($this->value !== null) {534 $size += 1;535 $size += $calculator->computeByteStreamSize($this->value);536 }537 538 if ($this->content_type !== null) {539 $size += 1;540 $size += $calculator->computeVarintSize($this->content_type->value());541 }542 543 if ($this->artifact_signature !== null) {544 $size += 1;545 $size += $calculator->computeByteStreamSize($this->artifact_signature);546 }547 548 if ($this->sub_type !== null) {549 $size += 1;550 $size += $calculator->computeStringSize($this->sub_type);551 }552 553 if ($this->signed_time_stamp !== null) {554 $size += 1;555 $size += $calculator->computeByteStreamSize($this->signed_time_stamp);556 }557 558 if ($this->extensions !== null) {559 $size += $this->extensions->serializedSize($context);560 }561 562 return $size;563 }564 565 /**566 * {@inheritdoc}567 */568 public function clear()569 {570 $this->name = null;571 $this->value = null;572 $this->content_type = null;573 $this->artifact_signature = null;574 $this->sub_type = null;575 $this->signed_time_stamp = null;576 }577 578 /**579 * {@inheritdoc}580 */581 public function merge(\Protobuf\Message $message)582 {583 if ( ! $message instanceof \attrpubapi_v1\AttributeSigning) {584 throw new \InvalidArgumentException(sprintf('Argument 1 passed to %s must be a %s, %s given', __METHOD__, __CLASS__, get_class($message)));585 }586 587 $this->name = ($message->name !== null) ? $message->name : $this->name;588 $this->value = ($message->value !== null) ? $message->value : $this->value;589 $this->content_type = ($message->content_type !== null) ? $message->content_type : $this->content_type;590 $this->artifact_signature = ($message->artifact_signature !== null) ? $message->artifact_signature : $this->artifact_signature;591 $this->sub_type = ($message->sub_type !== null) ? $message->sub_type : $this->sub_type;592 $this->signed_time_stamp = ($message->signed_time_stamp !== null) ? $message->signed_time_stamp : $this->signed_time_stamp;593 }594 595 175 596 176 } -
yoti/trunk/sdk/attrpubapi_v1/ContentType.php
r1707648 r1920337 1 1 <?php 2 /** 3 * Generated by Protobuf protoc plugin. 4 * 5 * File descriptor : Attribute.proto 6 */ 2 # Generated by the protocol buffer compiler. DO NOT EDIT! 3 # source: Attribute.proto 7 4 8 9 namespace attrpubapi_v1; 5 namespace Attrpubapi_v1; 10 6 11 7 /** 12 * Protobuf enum : attrpubapi_v1.ContentType 8 * ContentType indicates how to interpret the ‘Value’ field of an Attribute. 9 * 10 * Protobuf enum <code>Attrpubapi_v1\ContentType</code> 13 11 */ 14 class ContentType extends \Protobuf\Enum12 class ContentType 15 13 { 16 17 14 /** 18 * UNDEFINED = 0 15 * UNDEFINED should not be seen, and is used as an error placeholder 16 * value. 17 * 18 * Generated from protobuf enum <code>UNDEFINED = 0;</code> 19 19 */ 20 const UNDEFINED_VALUE = 0; 21 20 const UNDEFINED = 0; 22 21 /** 23 * STRING = 1 22 * STRING means the value is UTF-8 encoded text. 23 * 24 * Generated from protobuf enum <code>STRING = 1;</code> 24 25 */ 25 const STRING_VALUE = 1; 26 26 const STRING = 1; 27 27 /** 28 * JPEG = 2 28 * JPEG indicates a standard .jpeg image. 29 * 30 * Generated from protobuf enum <code>JPEG = 2;</code> 29 31 */ 30 const JPEG_VALUE = 2; 31 32 const JPEG = 2; 32 33 /** 33 * DATE = 3 34 * Date as string in RFC3339 format (YYYY-MM-DD). 35 * 36 * Generated from protobuf enum <code>DATE = 3;</code> 34 37 */ 35 const DATE_VALUE = 3; 36 38 const DATE = 3; 37 39 /** 38 * PNG = 4 40 * PNG indicates a standard .png image. 41 * 42 * Generated from protobuf enum <code>PNG = 4;</code> 39 43 */ 40 const PNG_VALUE = 4; 41 42 /** 43 * @var \attrpubapi_v1\ContentType 44 */ 45 protected static $UNDEFINED = null; 46 47 /** 48 * @var \attrpubapi_v1\ContentType 49 */ 50 protected static $STRING = null; 51 52 /** 53 * @var \attrpubapi_v1\ContentType 54 */ 55 protected static $JPEG = null; 56 57 /** 58 * @var \attrpubapi_v1\ContentType 59 */ 60 protected static $DATE = null; 61 62 /** 63 * @var \attrpubapi_v1\ContentType 64 */ 65 protected static $PNG = null; 66 67 /** 68 * @return \attrpubapi_v1\ContentType 69 */ 70 public static function UNDEFINED() 71 { 72 if (self::$UNDEFINED !== null) { 73 return self::$UNDEFINED; 74 } 75 76 return self::$UNDEFINED = new self('UNDEFINED', self::UNDEFINED_VALUE); 77 } 78 79 /** 80 * @return \attrpubapi_v1\ContentType 81 */ 82 public static function STRING() 83 { 84 if (self::$STRING !== null) { 85 return self::$STRING; 86 } 87 88 return self::$STRING = new self('STRING', self::STRING_VALUE); 89 } 90 91 /** 92 * @return \attrpubapi_v1\ContentType 93 */ 94 public static function JPEG() 95 { 96 if (self::$JPEG !== null) { 97 return self::$JPEG; 98 } 99 100 return self::$JPEG = new self('JPEG', self::JPEG_VALUE); 101 } 102 103 /** 104 * @return \attrpubapi_v1\ContentType 105 */ 106 public static function DATE() 107 { 108 if (self::$DATE !== null) { 109 return self::$DATE; 110 } 111 112 return self::$DATE = new self('DATE', self::DATE_VALUE); 113 } 114 115 /** 116 * @return \attrpubapi_v1\ContentType 117 */ 118 public static function PNG() 119 { 120 if (self::$PNG !== null) { 121 return self::$PNG; 122 } 123 124 return self::$PNG = new self('PNG', self::PNG_VALUE); 125 } 126 127 /** 128 * @param int $value 129 * @return \attrpubapi_v1\ContentType 130 */ 131 public static function valueOf($value) 132 { 133 switch ($value) { 134 case 0: return self::UNDEFINED(); 135 case 1: return self::STRING(); 136 case 2: return self::JPEG(); 137 case 3: return self::DATE(); 138 case 4: return self::PNG(); 139 default: return null; 140 } 141 } 142 143 44 const PNG = 4; 144 45 } 145 46 -
yoti/trunk/sdk/boot.php
r1840797 r1920337 5 5 */ 6 6 7 require_once __DIR__ . '/protobuf-php/protobuf/src/Message.php'; 8 require_once __DIR__ . '/protobuf-php/protobuf/src/AbstractMessage.php'; 9 require_once __DIR__ . '/protobuf-php/protobuf/src/Unknown.php'; 10 require_once __DIR__ . '/protobuf-php/protobuf/src/Enum.php'; 11 require_once __DIR__ . '/protobuf-php/protobuf/src/Configuration.php'; 12 require_once __DIR__ . '/protobuf-php/protobuf/src/Binary/StreamReader.php'; 13 require_once __DIR__ . '/protobuf-php/protobuf/src/Binary/Platform/BigEndian.php'; 14 require_once __DIR__ . '/protobuf-php/protobuf/src/ReadContext.php'; 15 require_once __DIR__ . '/protobuf-php/protobuf/src/Stream.php'; 16 require_once __DIR__ . '/protobuf-php/protobuf/src/WireFormat.php'; 17 require_once __DIR__ . '/protobuf-php/protobuf/src/Field.php'; 18 require_once __DIR__ . '/protobuf-php/protobuf/src/Collection.php'; 19 require_once __DIR__ . '/protobuf-php/protobuf/src/MessageCollection.php'; 20 require_once __DIR__ . '/protobuf-php/protobuf/src/StreamCollection.php'; 21 require_once __DIR__ . '/protobuf-php/protobuf/src/UnknownFieldSet.php'; 7 // PHP Secure files 8 require_once __DIR__ . '/phpseclib/bootstrap.php'; 22 9 23 require_once __DIR__ . '/attrpubapi_v1/Anchor.php'; 24 require_once __DIR__ . '/attrpubapi_v1/Attribute.php'; 25 require_once __DIR__ . '/attrpubapi_v1/AttributeList.php'; 26 require_once __DIR__ . '/attrpubapi_v1/ContentType.php'; 27 require_once __DIR__ . '/compubapi_v1/EncryptedData.php'; 10 // Autoload Yoti classes and other dependencies 11 spl_autoload_register(function($className) { 12 if (strpos($className, 'Google\Protobuf') !== false || strpos($className, 'GPBMetadata') !== false) { 28 13 29 // Autoload Yoti classes 30 spl_autoload_register(function($className) { 14 $className = 'protobuflib\\' . $className; 15 } 31 16 $file = __DIR__ . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $className).'.php'; 32 17 if (file_exists($file)) { -
yoti/trunk/sdk/compubapi_v1/EncryptedData.php
r1707648 r1920337 1 1 <?php 2 /** 3 * Generated by Protobuf protoc plugin. 4 * 5 * File descriptor : EncryptedData.proto 6 */ 2 # Generated by the protocol buffer compiler. DO NOT EDIT! 3 # source: EncryptedData.proto 7 4 5 namespace Compubapi_v1; 8 6 9 namespace compubapi_v1;7 use Google\Protobuf\Internal\GPBUtil; 10 8 11 9 /** 12 * Protobuf message : compubapi_v1.EncryptedData10 * Generated from protobuf message <code>compubapi_v1.EncryptedData</code> 13 11 */ 14 class EncryptedData extends \ Protobuf\AbstractMessage12 class EncryptedData extends \Google\Protobuf\Internal\Message 15 13 { 14 /** 15 * the iv will be used in conjunction with the secret key 16 * received via other channel in order to decrypt the cipher_text 17 * 18 * Generated from protobuf field <code>bytes iv = 1;</code> 19 */ 20 private $iv = ''; 21 /** 22 * block of bytes to be decrypted 23 * 24 * Generated from protobuf field <code>bytes cipher_text = 2;</code> 25 */ 26 private $cipher_text = ''; 16 27 17 /** 18 * @var \Protobuf\UnknownFieldSet 19 */ 20 protected $unknownFieldSet = null; 21 22 /** 23 * @var \Protobuf\Extension\ExtensionFieldMap 24 */ 25 protected $extensions = null; 26 27 /** 28 * iv optional bytes = 1 29 * 30 * @var \Protobuf\Stream 31 */ 32 protected $iv = null; 33 34 /** 35 * cipher_text optional bytes = 2 36 * 37 * @var \Protobuf\Stream 38 */ 39 protected $cipher_text = null; 40 41 /** 42 * Check if 'iv' has a value 43 * 44 * @return bool 45 */ 46 public function hasIv() 47 { 48 return $this->iv !== null; 28 public function __construct() { 29 \GPBMetadata\EncryptedData::initOnce(); 30 parent::__construct(); 49 31 } 50 32 51 33 /** 52 * Get 'iv' value 34 * the iv will be used in conjunction with the secret key 35 * received via other channel in order to decrypt the cipher_text 53 36 * 54 * @return \Protobuf\Stream 37 * Generated from protobuf field <code>bytes iv = 1;</code> 38 * @return string 55 39 */ 56 40 public function getIv() … … 60 44 61 45 /** 62 * Set 'iv' value 46 * the iv will be used in conjunction with the secret key 47 * received via other channel in order to decrypt the cipher_text 63 48 * 64 * @param \Protobuf\Stream $value 49 * Generated from protobuf field <code>bytes iv = 1;</code> 50 * @param string $var 51 * @return $this 65 52 */ 66 public function setIv($va lue = null)53 public function setIv($var) 67 54 { 68 if ($value !== null && ! $value instanceof \Protobuf\Stream) { 69 $value = \Protobuf\Stream::wrap($value); 70 } 55 GPBUtil::checkString($var, False); 56 $this->iv = $var; 71 57 72 $this->iv = $value;58 return $this; 73 59 } 74 60 75 61 /** 76 * Check if 'cipher_text' has a value62 * block of bytes to be decrypted 77 63 * 78 * @return bool 79 */ 80 public function hasCipherText() 81 { 82 return $this->cipher_text !== null; 83 } 84 85 /** 86 * Get 'cipher_text' value 87 * 88 * @return \Protobuf\Stream 64 * Generated from protobuf field <code>bytes cipher_text = 2;</code> 65 * @return string 89 66 */ 90 67 public function getCipherText() … … 94 71 95 72 /** 96 * Set 'cipher_text' value73 * block of bytes to be decrypted 97 74 * 98 * @param \Protobuf\Stream $value 75 * Generated from protobuf field <code>bytes cipher_text = 2;</code> 76 * @param string $var 77 * @return $this 99 78 */ 100 public function setCipherText($va lue = null)79 public function setCipherText($var) 101 80 { 102 if ($value !== null && ! $value instanceof \Protobuf\Stream) { 103 $value = \Protobuf\Stream::wrap($value); 104 } 81 GPBUtil::checkString($var, False); 82 $this->cipher_text = $var; 105 83 106 $this->cipher_text = $value;84 return $this; 107 85 } 108 109 /**110 * {@inheritdoc}111 */112 public function extensions()113 {114 if ( $this->extensions !== null) {115 return $this->extensions;116 }117 118 return $this->extensions = new \Protobuf\Extension\ExtensionFieldMap(__CLASS__);119 }120 121 /**122 * {@inheritdoc}123 */124 public function unknownFieldSet()125 {126 return $this->unknownFieldSet;127 }128 129 /**130 * {@inheritdoc}131 */132 public static function fromStream($stream, \Protobuf\Configuration $configuration = null)133 {134 return new self($stream, $configuration);135 }136 137 /**138 * {@inheritdoc}139 */140 public static function fromArray(array $values)141 {142 $message = new self();143 $values = array_merge([144 'iv' => null,145 'cipher_text' => null146 ], $values);147 148 $message->setIv($values['iv']);149 $message->setCipherText($values['cipher_text']);150 151 return $message;152 }153 154 /**155 * {@inheritdoc}156 */157 public static function descriptor()158 {159 return \google\protobuf\DescriptorProto::fromArray([160 'name' => 'EncryptedData',161 'field' => [162 \google\protobuf\FieldDescriptorProto::fromArray([163 'number' => 1,164 'name' => 'iv',165 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_BYTES(),166 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()167 ]),168 \google\protobuf\FieldDescriptorProto::fromArray([169 'number' => 2,170 'name' => 'cipher_text',171 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_BYTES(),172 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()173 ]),174 ],175 ]);176 }177 178 /**179 * {@inheritdoc}180 */181 public function toStream(\Protobuf\Configuration $configuration = null)182 {183 $config = $configuration ?: \Protobuf\Configuration::getInstance();184 $context = $config->createWriteContext();185 $stream = $context->getStream();186 187 $this->writeTo($context);188 $stream->seek(0);189 190 return $stream;191 }192 193 /**194 * {@inheritdoc}195 */196 public function writeTo(\Protobuf\WriteContext $context)197 {198 $stream = $context->getStream();199 $writer = $context->getWriter();200 $sizeContext = $context->getComputeSizeContext();201 202 if ($this->iv !== null) {203 $writer->writeVarint($stream, 10);204 $writer->writeByteStream($stream, $this->iv);205 }206 207 if ($this->cipher_text !== null) {208 $writer->writeVarint($stream, 18);209 $writer->writeByteStream($stream, $this->cipher_text);210 }211 212 if ($this->extensions !== null) {213 $this->extensions->writeTo($context);214 }215 216 return $stream;217 }218 219 /**220 * {@inheritdoc}221 */222 public function readFrom(\Protobuf\ReadContext $context)223 {224 $reader = $context->getReader();225 $length = $context->getLength();226 $stream = $context->getStream();227 228 $limit = ($length !== null)229 ? ($stream->tell() + $length)230 : null;231 232 while ($limit === null || $stream->tell() < $limit) {233 234 if ($stream->eof()) {235 break;236 }237 238 $key = $reader->readVarint($stream);239 $wire = \Protobuf\WireFormat::getTagWireType($key);240 $tag = \Protobuf\WireFormat::getTagFieldNumber($key);241 242 if ($stream->eof()) {243 break;244 }245 246 if ($tag === 1) {247 \Protobuf\WireFormat::assertWireType($wire, 12);248 249 $this->iv = $reader->readByteStream($stream);250 251 continue;252 }253 254 if ($tag === 2) {255 \Protobuf\WireFormat::assertWireType($wire, 12);256 257 $this->cipher_text = $reader->readByteStream($stream);258 259 continue;260 }261 262 $extensions = $context->getExtensionRegistry();263 $extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;264 265 if ($extension !== null) {266 $this->extensions()->add($extension, $extension->readFrom($context, $wire));267 268 continue;269 }270 271 if ($this->unknownFieldSet === null) {272 $this->unknownFieldSet = new \Protobuf\UnknownFieldSet();273 }274 275 $data = $reader->readUnknown($stream, $wire);276 $unknown = new \Protobuf\Unknown($tag, $wire, $data);277 278 $this->unknownFieldSet->add($unknown);279 280 }281 }282 283 /**284 * {@inheritdoc}285 */286 public function serializedSize(\Protobuf\ComputeSizeContext $context)287 {288 $calculator = $context->getSizeCalculator();289 $size = 0;290 291 if ($this->iv !== null) {292 $size += 1;293 $size += $calculator->computeByteStreamSize($this->iv);294 }295 296 if ($this->cipher_text !== null) {297 $size += 1;298 $size += $calculator->computeByteStreamSize($this->cipher_text);299 }300 301 if ($this->extensions !== null) {302 $size += $this->extensions->serializedSize($context);303 }304 305 return $size;306 }307 308 /**309 * {@inheritdoc}310 */311 public function clear()312 {313 $this->iv = null;314 $this->cipher_text = null;315 }316 317 /**318 * {@inheritdoc}319 */320 public function merge(\Protobuf\Message $message)321 {322 if ( ! $message instanceof \compubapi_v1\EncryptedData) {323 throw new \InvalidArgumentException(sprintf('Argument 1 passed to %s must be a %s, %s given', __METHOD__, __CLASS__, get_class($message)));324 }325 326 $this->iv = ($message->iv !== null) ? $message->iv : $this->iv;327 $this->cipher_text = ($message->cipher_text !== null) ? $message->cipher_text : $this->cipher_text;328 }329 330 86 331 87 } -
yoti/trunk/sdk/proto/Attribute.proto
r1707648 r1920337 1 //syntax = "proto2";1 syntax = "proto3"; 2 2 3 3 package attrpubapi_v1; … … 28 28 29 29 message Attribute { 30 optionalstring name = 1;30 string name = 1; 31 31 32 optionalbytes value = 2;32 bytes value = 2; 33 33 34 optionalContentType content_type = 3;34 ContentType content_type = 3; 35 35 36 36 repeated Anchor anchors = 4; … … 39 39 40 40 message Anchor { 41 optionalbytes artifact_link = 1;41 bytes artifact_link = 1; 42 42 43 43 repeated bytes origin_server_certs = 2; 44 44 45 optionalbytes artifact_signature = 3;45 bytes artifact_signature = 3; 46 46 47 optionalstring sub_type = 4;47 string sub_type = 4; 48 48 49 optionalbytes signature = 5;49 bytes signature = 5; 50 50 51 optionalbytes signed_time_stamp = 6;51 bytes signed_time_stamp = 6; 52 52 } -
yoti/trunk/sdk/proto/EncryptedData.proto
r1707648 r1920337 1 // syntax = "proto2";1 syntax = "proto3"; 2 2 3 3 package compubapi_v1; … … 9 9 // the iv will be used in conjunction with the secret key 10 10 // received via other channel in order to decrypt the cipher_text 11 optionalbytes iv = 1;11 bytes iv = 1; 12 12 13 13 // block of bytes to be decrypted 14 optionalbytes cipher_text = 2;14 bytes cipher_text = 2; 15 15 } -
yoti/trunk/sdk/proto/List.proto
r1707648 r1920337 1 //syntax = "proto2";1 syntax = "proto3"; 2 2 3 3 package attrpubapi_v1; … … 12 12 // alongside its ID. 13 13 message AttributeAndId { 14 optionalAttribute attribute = 1;14 Attribute attribute = 1; 15 15 16 optionalbytes attribute_id = 2;16 bytes attribute_id = 2; 17 17 } 18 18 -
yoti/trunk/sdk/proto/Signing.proto
r1707648 r1920337 1 //syntax = "proto2";1 syntax = "proto3"; 2 2 3 3 package attrpubapi_v1; … … 10 10 11 11 message AttributeSigning { 12 optionalstring name = 1;12 string name = 1; 13 13 14 optionalbytes value = 2;14 bytes value = 2; 15 15 16 optionalContentType content_type = 3;16 ContentType content_type = 3; 17 17 18 optionalbytes artifact_signature = 4;18 bytes artifact_signature = 4; 19 19 20 optionalstring sub_type = 5;20 string sub_type = 5; 21 21 22 optionalbytes signed_time_stamp = 6;22 bytes signed_time_stamp = 6; 23 23 } -
yoti/trunk/views/admin-options.php
r1840797 r1920337 15 15 <h1>Yoti Settings</h1> 16 16 <p>You need to first create a Yoti App at <?php echo $dashboardLink ?>.</p> 17 <p>Note: On the Yoti Dashboard the callback URL should be set to: <code><?php echo site_url('wp-login.php?yoti-select=1&action=link', 'https'); ?></code></p> 17 <p>Note: On the Yoti Dashboard the application domain should be set to <code><?php echo site_url('', 'https'); ?></code>, <br>And the scenario callback URL should be set to: <code><?php echo site_url('wp-login.php?yoti-select=1&action=link', 'https'); ?></code></p> 18 <p>Warning: User IDs provided by Yoti are unique to each Yoti Application. Using a different Yoti Application means you will receive a different Yoti User ID for all of your users.</p> 18 19 <?php 19 20 if ($updateMessage) { -
yoti/trunk/yoti.php
r1852630 r1920337 5 5 Plugin URI: https://wordpress.org/plugins/yoti/ 6 6 Description: Let Yoti users quickly register on your site. 7 Version: 1.1. 87 Version: 1.1.9 8 8 Author: Yoti SDK. 9 9 Author URI: https://yoti.com
Note: See TracChangeset
for help on using the changeset viewer.