InvalidBerData class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
 
m (add link to exception example)
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
The <var>InvalidBerData</var> class has properties that indicate the position and description of the non-conforming data. There are currently no standardized error codes.
The <var>InvalidBerData</var> class has properties that indicate the position and description of the non-conforming data. There are currently no standardized error codes.
   
   
An <var>InvalidBerData</var> exception can be thrown by any of the [[SSL security changes in V8.0#XmlDoc version of SSL entities|DER-to-XmlDoc]] methods.
An <var>InvalidBerData</var> exception can be thrown by any of the [[Release notes for Sirius Mods V8.0#DER2Xml|DER-to-XmlDoc]] methods.


To produce an <var>InvalidBerData</var> exception for yourself, you typically use a <var class="product">User Language</var> <var>[[Exceptions#Throwing exceptions|Throw]]</var> statement calling the <var>InvalidBerData</var> <var>[[New_(InvalidBerData_constructor)|New]]</var> constructor:
To produce an <var>InvalidBerData</var> exception for yourself, you typically use a <var class="product">User Language</var> <var>[[Exceptions#Throwing exceptions|Throw]]</var> statement calling the <var>InvalidBerData</var> <var>[[New_(InvalidBerData_constructor)|New]]</var> constructor:
Line 10: Line 10:
</p>
</p>
   
   
For an outline of how you might use an exception in a function of your own, see this [[Get (HttpRequest function)#exception-eg|Get method example]].
The methods of the <var>InvalidBerData</var> exception class are described below.
The methods of the <var>InvalidBerData</var> exception class are described below.
    
    
Line 20: Line 22:
The methods in the class are described in the subsections that follow. In addition:
The methods in the class are described in the subsections that follow. In addition:
<ul>
<ul>
<li>[[Notation conventions for methods|"Notation conventions for methods"]] has information
<li>[[Notation conventions for methods]] has information
about the conventions followed.  
about the conventions followed.  
<li>[[InvalidBerData methods syntax|"InvalidBerData methods syntax"]] is a single page that contains the syntax diagrams of the methods in the class.
<li>[[InvalidBerData methods syntax]] is a single page that contains the syntax diagrams of the methods in the class.
</ul>
</ul>


Line 48: Line 50:
===Syntax===
===Syntax===
{{Template:InvalidBerData:New syntax}}
{{Template:InvalidBerData:New syntax}}
====Syntax terms====
====Syntax terms====
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%invalidBerData</th>
<tr><th>%invalidBerData</th>
<td>A reference to an instance of a <var>InvalidBerData</var> object.</td></tr>
<td>A reference to an instance of a <var>InvalidBerData</var> object.</td></tr>
<tr><th><var class="nobr">%(InvalidBerData)</var></th><td>The class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. See [[#Usage notes|"Usage notes"]], below, for more information about invoking a <var>InvalidBerData</var> <var>Constructor</var>.</td></tr>
 
<tr><th><var class="nobr">%(InvalidBerData)</var></th><td>The class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. See [[#Usage notes|Usage notes]], below, for more information about invoking a <var>InvalidBerData</var> <var>Constructor</var>.</td></tr>
 
<tr><th><var>Position</var></th>
<tr><th><var>Position</var></th>
<td>This [[Methods#Named parameters|name required]] parameter: <var>Position</var>, specifies the numeric value (<var class="term">number</var>) for the position to be assigned to the <var>InvalidBerData</var> exception object's <var>Position</var> property when a data error is encountered. </td></tr>
<td>This [[Methods#Named parameters|name required]] parameter: <var>Position</var>, specifies the numeric value (<var class="term">number</var>) for the position to be assigned to the <var>InvalidBerData</var> exception object's <var>Position</var> property when a data error is encountered. </td></tr>
<tr><th><var>Description</var></th>
<tr><th><var>Description</var></th>
<td>This name required parameter: <var>Description</var>, is the string, containing a brief description of the exception, that is assigned to the <var>InvalidBerData</var> exception object's <var>Description</var> property when a data error is encountered. </td></tr>
<td>This name required parameter: <var>Description</var>, is the string, containing a brief description of the exception, that is assigned to the <var>InvalidBerData</var> exception object's <var>Description</var> property when a data error is encountered. </td></tr>
Line 61: Line 67:
===Usage notes===
===Usage notes===
<ul>
<ul>
<li>As described in [[Object variables#Using New or other Constructors|"Using New or other Constructors"]], <var>New</var> can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is <var>Null</var>:<p class="code">%invalidBer = new(position=1, description='unexpected junk after end of BER data')
<li>As described in [[Object variables#Using New or other Constructors|Using New or other Constructors]], <var>New</var> can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is <var>Null</var>:<p class="code">%invalidBer = new(position=1, description='unexpected junk after end of BER data')


%invalidBer = %(InvalidBerData):new(position=1, description='did not get expected tag')
%invalidBer = %(InvalidBerData):new(position=1, description='did not get expected tag')

Latest revision as of 18:39, 15 March 2016

The InvalidBerData exception class validates whether the data being processed by the called method conforms to the BER (Basic Encoding Rules) protocol. BER data is base64-encoded binary data; BER rules are a superset of DER (Distinguished Encoding Rules) rules.

The InvalidBerData class has properties that indicate the position and description of the non-conforming data. There are currently no standardized error codes.

An InvalidBerData exception can be thrown by any of the DER-to-XmlDoc methods.

To produce an InvalidBerData exception for yourself, you typically use a User Language Throw statement calling the InvalidBerData New constructor:

throw %(InvalidBerData):new(position=13, description='did not get expected tag')

For an outline of how you might use an exception in a function of your own, see this Get method example.

The methods of the InvalidBerData exception class are described below.

This class is available as of Sirius Mods Version 8.0.


The InvalidBerData methods

The following are the available InvalidBerData class methods.

MethodDescription
DescriptionDescription of error
NewCreate a new InvalidBerData object
PositionPosition where error encountered

The methods in the class are described in the subsections that follow. In addition:

Description property

Description of error (InvalidBerData class)

[Introduced in Sirius Mods 8.0]

This ReadOnly property returns a description of the data error.

Syntax

%string = invalidBerData:Description

Syntax terms

%number This numeric value is the line in the data being validated where a non-PEM-conforming character was found.
invalidBerData A reference to an instance of an InvalidBerData object.

New constructor

Create a new InvalidBerData object (InvalidBerData class)

[Introduced in Sirius Mods 8.0]

This method generates an instance of an InvalidBerData exception. The New method format is as follows:

Syntax

%invalidBerData = [%(InvalidBerData):]New( Position= number, - Description= string)

Syntax terms

%invalidBerData A reference to an instance of a InvalidBerData object.
%(InvalidBerData)The class name in parentheses denotes a Constructor. See Usage notes, below, for more information about invoking a InvalidBerData Constructor.
Position This name required parameter: Position, specifies the numeric value (number) for the position to be assigned to the InvalidBerData exception object's Position property when a data error is encountered.
Description This name required parameter: Description, is the string, containing a brief description of the exception, that is assigned to the InvalidBerData exception object's Description property when a data error is encountered.

Usage notes

  • As described in Using New or other Constructors, New can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is Null:

    %invalidBer = new(position=1, description='unexpected junk after end of BER data') %invalidBer = %(InvalidBerData):new(position=1, description='did not get expected tag') %invalidBer = %invalidBer:new(position=1, description='unexpected junk after end of BER data')

Position property

Position where error encountered (InvalidBerData class)

[Introduced in Sirius Mods 8.0]

This ReadOnly property returns the position in the (expected) base64-encoded string where a non-BER-conforming character was found.

Syntax

%number = invalidBerData:Position

Syntax terms

%number This numeric value is the position in the base64 string (in the line identified by the value of Line) where a non-BER-conforming character was found.
invalidBerData A reference to an instance of an InvalidBerData object.