|
Returns an
Array
of
Array
elements each of which contains four
String
elements.
The four strings represent the following provider algorithm information:
provider name, operation, specific name and specific value, respectively.
The output, then, is essentially a table with the entries in the returned array
representing rows and the entries in those rows representing columns.
If no arguments are provided to the built-in, all rows are included in the table.
Otherwise, the arguments act as filters and may be either a
String,
which is treated as a shell (or glob), single-byte pattern for pattern matching,
or a
Regexp.
The first argument is used to match against the first of the four string elements,
i.e., elements in the first column.
The second argument, if present, matches against the second column, and so on.
A final
int
argument can be used to ignore or accept any row that has a column element containing a
dot character (i.e., a period or decimal point).
| |
| Example: |
The following script:
import yoix.*.*;
Pointer rows, cols;
Array results = getProviderInfo("*", "KeyStore", false);
truncator(Array cols) {
Pointer ptr = cols;;
while(ptr@sizeof > 0) {
if (strlen(*ptr) > 19)
*ptr = substring(*ptr, 0, 16) + "...";
ptr++;
}
return(cols);
}
printf("%-11s %-11s %-19s %-19s\n",
"Provider", "Operation", "Name", "Value");
printf("%-11s %-11s %-19s %-19s\n",
"========", "=========", "====", "=====");
for (rows = results; rows@sizeof > 0; rows++) {
cols = *rows;
printf("%-11s %-11s %-19s %-19s\n",
unroll(truncator(*rows)));
}
selects rows of provider information that involve the KeyStore operation and
prints them out in a table format. Although peripheral to the focus of this
example, the truncator function is used to keep the output
lines from wrapping in an 80 column terminal window. Note the use of
unroll.
We could have used the
printf
format
%-19.19s
to prevent line wrapping, but ellipses are a bit friendlier.
An example of the output is shown below:
Provider Operation Name Value
======== ========= ==== =====
SUN KeyStore JKS ImplementedIn Software
SUN KeyStore JKS sun.security.pro...
SUN KeyStore CaseExactJKS sun.security.pro...
Apple KeyStore KeychainStore com.apple.crypto...
SunJSSE KeyStore PKCS12 com.sun.net.ssl....
SunJCE KeyStore JCEKS com.sun.crypto.p...
| | |
| Return: |
Array
| | |
| See Also: |
adjustSecurity,
| | |
| See Also: |
getCertificate,
getProviders
|
|