Illegal character in Auth-Header

Hi,
I am trying to send a SOAP Message from a HCP Application to a Webservice from Cloud for Customer.
The request uses basic authentication.
My problem now is, that I get a SOAP Exception saying that there is a illegal character in the auth header.
Illegal character(s) in message header value: Basic
After searching in google I think that there is a new line character at the end of the credentials which causes
the error and this seems to be a bug in a library from sun. However I use the apache implementation of the
Base64 class and I tested whether there is such a new line character but everything is alright.
If I run it as a local Java application every works fine and the request is successful but in the cloud environment
I always get this error.
Does anyone face the same issue or know a resolution to this problem?
Any help will be appreciated.
Thanks in advance and best regards
Felix

Hi ejp,
It's a rsa public, the usercert.pem looks like below,
so since it's not an x509 certificate not sure if I
can read it using a
java.security.cert.CertificateFactory?
Basically I just want to print the public and private
key out as a String. Any help is appreciated.
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCg8yo6rDhsNiwUfV
R37HgF4bWq
oG13Nd9XLT+Z0VLzCkWJZOdzGNQnnm7ujoQ8gbxeDvIo9RG5I3eZte
BwD91Nf6P/
E9lvJQDL2Qnz4EXH/CVW9DeEfvY1UJN9kc6q6KkYEPWssvVvlDOp2s
lbEKZCJtaP
vVuGCAqfaps8J0FjOQIDAQAB
-----END PUBLIC KEY-----
import java.security.KeyFactory;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.X509EncodedKeySpec;
import sun.misc.BASE64Decoder;
public class MakeRSAPublicKeyFromPEM
    public static void main(String[] args) throws Exception
        final String publickeyAsString =
                "-----BEGIN PUBLIC KEY-----\n"+
                "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCg8yo6rDhsNiwUfVR37HgF4bWq\n"+
                "oG13Nd9XLT+Z0VLzCkWJZOdzGNQnnm7ujoQ8gbxeDvIo9RG5I3eZteBwD91Nf6P/\n"+
                "E9lvJQDL2Qnz4EXH/CVW9DeEfvY1UJN9kc6q6KkYEPWssvVvlDOp2slbEKZCJtaP\n"+
                "vVuGCAqfaps8J0FjOQIDAQAB\n"+
                "-----END PUBLIC KEY-----\n";
        final BASE64Decoder decoder = new BASE64Decoder();
        final byte[] publicKeyAsBytes = decoder.decodeBuffer(publickeyAsString.replaceAll("-+.*?-+",""));
        final X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(publicKeyAsBytes);
        final KeyFactory keyFactory = KeyFactory.getInstance("RSA");
        final RSAPublicKey publicKey = (RSAPublicKey)keyFactory.generatePublic(publicKeySpec);
        System.out.println("Modulus ........... " + publicKey.getModulus());
        System.out.println("Public exponent ... " + publicKey.getPublicExponent());
}

Similar Messages

  • Unable to run project: illegal character in path - Flash Catalyst CS5.5

    Environment is a new install of Windows 7 x64 on a new Dell workstation in an Active Directory environment. Until fall of last year, we used redirected folders for the Application Data folders until issues with Adobe Reader 9.x forced us to abandon that and we reconfigured our network not to use redirected folders. We have not experienced any issues and all programs are using the Application Data folder on the local machines.
    Just installed Adobe Master Collection on a new workstation and all Adobe applications are using the C:\Users\cballew\AppData\Roaming\Adobe folder including Flash Catalyst. However, when I try to Run Project in Catalyst, it created a folder named Application Data using the network path to where we used to store the Application Data folder and is saving its workspace there. No other programs (including Adobe products) are doing this. Any ideads of how to fix it?
    Error message:
    Unable to run project
    Illegal character in path at index 47: file:///////xxxx.corp/home$/cballew/Application Data/Adobe/Flash Catalysts CS5.5/workspace/Project/bin-debug/Maim.html

    This seems to be configured in an ini file located at C:\Program Files (x86)\Adobe\Adobe Flash Catalyst CS5.5\configuration\config.ini
    [email protected]/Application Data/Adobe/Flash Catalyst CS5.5/workspace
    [email protected]/Application Data/Adobe/Flash Catalyst CS5.5
    [email protected]/Application Data/Adobe/Flash Catalyst CS5.5/configuration
    Can anyone tell me where the variable @user.home is defined and whether I can change it or not? I might find that some of the other applications might experience this same issue

  • Illegal character error on good filename

    I created a new RoboHelp project and tried to insert a graphic named Timeline.jpg. I got the following error:
    Unable to rename file, "Timeline.jpg".
    The filename contains illegal characters.
    I tried inserting a graphic that I had used in a previous RoboHelp project and got the same error. Then I opened a previous RoboHelp project and was able to successfully insert the Timeline.jpg graphic into that project.
    I'm on Windows XP and RoboHelp 8. I would really like to avoid having to re-install RoboHelp, but I'm not sure where to look to troubleshoot this error message. Any help on this matter would be greatly appreciated.
    Thanks.

    Sorry that I wasn't more specific in reporting my solution.
    I cannot say that the deletion RB7 helped because I had done that before making my other changes.  Another website that I had visited suggested that Robo sometimes has a problem when a previous version still exists, so I can't say that removing it solved the problem.
    Previously, all the project files were in a folder on my desktop, several layers deep.  BeforeI upgraded to v.208 I did not have a problem inserting images and I never got the "illegal character name" or "cannot rename" errors.  AfterI upgraded the problems began.  BTW, I had checked the file path back to the image locations to make sure there were no spaces, illegal file names, etc.  So I knew the errors were bogus.
    After the upgrade I also noticed that all of the images I had previously inserted remained viewable in Preview Topic, but ALL of the images disappeared when I looked at the project after compilation.  At that time I was able to insert new images by saving them to the Gallery folder of RB8.  Perhaps I may have been able to insert them from another, nearby folder...I don't know.
    AfterI deleted RB7 I figured, heck, why not make everything clean and simple and copy the whole project from the desktop folder to a new folder in the root of "C."  When I re-opened the project everything was okay - back to normal.
    If I can suggest anything from my experience it would be that clean, simple directory structures are what RB-8.208 likes most and if you get too far away from RB's project folders you may get similar errors.
    Hope this helps, and thanks again for your assistance!
    John

  • Find and print illegal character in a string using regexp

    I have the following simple regexp that checks for illegal characters in a string:
    String regexp = ".*([\\[\\];]+|@).*"; // illegal: [ ] ; @
    String input = "Testing [ 123";
    System.out.println(Pattern.matches(regexp, input));How can I find and print the character that is invalid??
    I've tried using the Matcher class togheter with Pattern but cant get it to work. :(
    Like this:
    Pattern pattern = Pattern.compile(regexp);
    Matcher matcher = pattern.matcher(input);
    matcher.lookingAt();
    int matchedChar = matcher.end();
    if (matchedChar < input.length()) {
        String illegalCharFound = String.valueOf(input.charAt(matcher.end()));
        System.out.println(illegalCharFound);
    }What am I doing wrong?

    1. You call lookingAt(), but you don't check its return value, so you don't know if the regex actually matched.
    2. matcher.end() returns the index of the character following whatever was matched, assuming there was a match (if there wasn't, it will throw an exception). So either it will point to a legal character, or you'll get a StringIndexOutOfBoundsException because an illegal character was found at the end of the input. The start() method would be a better choice, but...
    3. Your regex can match multiple consecutive square brackets or semicolons (and why not put the at-sign in the character class, too?), but you're acting like it can only match one character. Even if there is only one character, group(1) is an easier way to extract it. Also, if there are more than one (non-consecutive) illegal characters, your regex will only find the last one. That's because the first dot-star initially gobbles up the whole input, then backtracks only as far as it has to to satisfy the rest of the regex. If your goal is to provide feedback to whoever supplied the input, it's going to be pretty confusing feedback. You should probably use the find() method in a loop to pick out all the illegal characters so you can report them properly.

  • Can't get past Illegal character 3

    Hello all. I can't get past Illegal Character 3 in JavaScript code. I think everything is closed off how it should be. Any ideas? Thanks.

    Ok, I did the quotes (hopefully right) but now the SyntaxError changed to: missing ; before statement 3: at line 4.
    Here's the code (sorry for not adding earlier).
    var msgAddress = "[email protected]";
    var msgSubject = "New Agent: " + getField("Name2").value;
    var msgBody = "The information is:""\r\nName:" + Name2.value + "\r\nEmail:" + Email2.value + "\r\nCell:" + CellPhone2.value + "\r\nDate of birth:" + DateOfBirth2.value;
    this.submitForm({cURL: "mailto:" + msgAddress + "?subject=" + escape(msgSubject) + "&body=" + escape(msgBody)});

  • [java]compiling .java at runtime...illegal character: \0

    i have an RMI method call that receives a string with the name of the file and an array of bytes that contains the file.
    this method has to save the file,compile it if it's a .java or run it directly is it's a .class
    the file arrives completely,but in compiling it i get an error telling there's an illegal character inside,which is ' \0 '
    isn't that suposed to be the end of the file?..if i print the file on my linux shell with the "more" command,the character doesn't come out either,do you have an idea about how could i get it out from there?..

    i have an RMI method call that receives a string with the name of the file and an array of bytes that contains the file.
    this method has to save the file,compile it if it's a .java or run it directly is it's a .class
    the file arrives completely,but in compiling it i get an error telling there's an illegal character inside,which is ' \0 '
    isn't that suposed to be the end of the file?..if i print the file on my linux shell with the "more" command,the character doesn't come out either,do you have an idea about how could i get it out from there?..

  • Illegal character in Base64 encoded data

    Hi,
    I'm trying to get a print out the public key as a String, which I am getting it in as a base64 encoded, but I get error:
    Exception in thread "main" java.lang.IllegalArgumentException: Illegal character in Base64 encoded data.
    Code below:
    public static void main(String[] args) {
              File pubKeyFile = new File("C:\\usercert.pem");
              StringBuffer buffer = new StringBuffer();
                   try {
                        FileInputStream fis = new FileInputStream(pubKeyFile);
                        try {
                             InputStreamReader isr = new InputStreamReader(fis, "UTF8");
                             Reader in = new BufferedReader(isr);
                             int ch;
                             while((ch = in.read()) > -1) {
                                  buffer.append((char)ch);
                             in.close();
                             String key = buffer.toString();
                             System.out.println("key is: " + key);
                                          //This is where the code fails:
                             String keyDecode = Base64.decodeString(key);
                             System.out.println("key ecode is: " + keyDecode);
                        } catch (UnsupportedEncodingException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                        } catch (IOException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                        }

    Hi ejp,
    It's a rsa public, the usercert.pem looks like below,
    so since it's not an x509 certificate not sure if I
    can read it using a
    java.security.cert.CertificateFactory?
    Basically I just want to print the public and private
    key out as a String. Any help is appreciated.
    -----BEGIN PUBLIC KEY-----
    MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCg8yo6rDhsNiwUfV
    R37HgF4bWq
    oG13Nd9XLT+Z0VLzCkWJZOdzGNQnnm7ujoQ8gbxeDvIo9RG5I3eZte
    BwD91Nf6P/
    E9lvJQDL2Qnz4EXH/CVW9DeEfvY1UJN9kc6q6KkYEPWssvVvlDOp2s
    lbEKZCJtaP
    vVuGCAqfaps8J0FjOQIDAQAB
    -----END PUBLIC KEY-----
    import java.security.KeyFactory;
    import java.security.interfaces.RSAPublicKey;
    import java.security.spec.X509EncodedKeySpec;
    import sun.misc.BASE64Decoder;
    public class MakeRSAPublicKeyFromPEM
        public static void main(String[] args) throws Exception
            final String publickeyAsString =
                    "-----BEGIN PUBLIC KEY-----\n"+
                    "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCg8yo6rDhsNiwUfVR37HgF4bWq\n"+
                    "oG13Nd9XLT+Z0VLzCkWJZOdzGNQnnm7ujoQ8gbxeDvIo9RG5I3eZteBwD91Nf6P/\n"+
                    "E9lvJQDL2Qnz4EXH/CVW9DeEfvY1UJN9kc6q6KkYEPWssvVvlDOp2slbEKZCJtaP\n"+
                    "vVuGCAqfaps8J0FjOQIDAQAB\n"+
                    "-----END PUBLIC KEY-----\n";
            final BASE64Decoder decoder = new BASE64Decoder();
            final byte[] publicKeyAsBytes = decoder.decodeBuffer(publickeyAsString.replaceAll("-+.*?-+",""));
            final X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(publicKeyAsBytes);
            final KeyFactory keyFactory = KeyFactory.getInstance("RSA");
            final RSAPublicKey publicKey = (RSAPublicKey)keyFactory.generatePublic(publicKeySpec);
            System.out.println("Modulus ........... " + publicKey.getModulus());
            System.out.println("Public exponent ... " + publicKey.getPublicExponent());
    }

  • Illegal character: \0

    hailstone.java:86: illegal character: \0
    ^
    I have no idea what can be wrong with my code. I made 2 programs and both of them have the same errors. from the above error, i can't tell what the problem could be.
    please help.

    save the source file in ANSI Encoding format and then compile the file.
    hailstone.java:86: illegal character: \0
    ^
    I have no idea what can be wrong with my code. I made
    2 programs and both of them have the same errors.
    from the above error, i can't tell what the problem
    could be.
    please help.

  • Illegal character \92 error.Tried everything

    Hi, Im trying to make a calculator program and in the line where I divide a by b, im getting an Illegal Character:\92 error for some reason. To type \ im using \\ as an escape character, and it seems to work earlier in the program with no problem.
    Heres the code:
    import java.io.*;
    public class PA83 //Simple calc
        public void calculator()
            try
                InputStreamReader isr = new InputStreamReader(System.in);
                BufferedReader br = new BufferedReader(isr);
                System.out.println("Enter number 1");
                double a = ((double) br.readLine());
                System.out.println("Enter number 2");
                double b = ((double) br.readLine());
                System.out.println("1.Add\n2.Subtract a-b\n3.Subtract b-a\n4.Multiply\n5.Divide a\\b\n6.Divide b\\a\n7.Quit");
                int c = Integer.parseInt(br.readLine());
                switch(c)
                    case 1:System.out.println(a+"+"+b+" = "+(a+b));
                    break;
                    case 2:System.out.println(a+"-"+b+" = "+(a-b));
                    break;
                    case 3:System.out.println(b+"-"+a+" = "+(b-a));
                    break;
                    case 4:System.out.println(a+"x"+b+" = "+(a*b));
                    break;
                    case 5:System.out.println(a+"\\"+b+" = "+(a\b));
                    break;
                    case 6:System.out.println(b+"\\"+a+" = "+(b\a));
                    break;
                    case 7:break;
                    case default:System.out.println("Invalid Option. Please select a number from 1-6");
                    break;
            catch(Exception e)
                System.out.println("Error: "+e.getMessage());
    }              It highlights case 5 and gives me an illegal character:\92 error, but ive used the double slashes(\\) earlier in the println to choose an option without any problem there.
    I dont understand why this is happening! Even if i remove the "\\" i get the same error , and as BlueJ suggested, i tried typing the line again to avoid some invisible character causing problems..

    Hi,
    I think we use "/" for division and not "\" .
    thanks & regards,
    Manoj

  • Error in Add/Replace Bulk Load component - illegal character in XML

    Has anyone ever seen the bulk load component complain about some illegal character in xml? I see this error and not sure what exactly the problem is:
    ERROR [SocketReader] - Received error message from server: Character is not legal in XML 1.0
    It's a very simple graph - reading data from clover data file and ingesting it straight into Endeca using the out of the box bulk load component.
    Thanks for your help!
    Edited by: 935345 on May 18, 2012 11:48 AM

    Assuming you are on EID 2.3, this transformation will apply the fix to all your string fields and print on your console the fields that had non-compliant XML 1.0 characters.
    //#CTL2
    string[] fields;
    // Transforms input record into output record.
    function integer transform() {
         $out.0.* = $in.0.*;
         for(integer i = $in.0.length() - 1; i >=0 ; i--) {
              if (getFieldType($in.0.*, i) == "string" && getFieldType($out.0.*, i) == "string") {
                   if (!isNull($in.0.*, i)) {
                        string originalValue = getStringValue($in.0.*, i);
                        string newValue = originalValue.replace("([^\\u0009\\u000a\\u000d\\u0020-\\uD7FF\\uE000-\\uFFFD]|[\\u0092\\u007F]+)","");
                        if (originalValue != newValue) {
                             fields[i] = getFieldName($in.0, i);
                        setStringValue($out.0.*, i, newValue);
         return OK;
    // Called during component initialization.
    // function boolean init() {}
    // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
    // required by the transform. All resources allocated within this method should be released
    // by the postExecute() method.
    // function void preExecute() {}
    // Called only if transform() throws an exception.
    // function integer transformOnError(string errorMessage, string stackTrace) {}
    // Called during each graph run after the entire transform was executed. Should be used to free any resources
    // allocated within the preExecute() method.
    function void postExecute() {
         printErr("Fields with non-compliant XML 1.0 characters");
         for(integer i = 0; i < fields.length(); i++) {
              if (fields[i] != null) {
                   printErr(fields);
    // Called to return a user-defined error message when an error occurs.
    // function string getMessage() {}
    -- Alex                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • "Message Illegal character used in property name" C4043 what is illegal?

    hi *,
    does anyone know what are legal chacters for JMS properties for SJSMQ?
    according to http://docs.sun.com/app/docs/doc/819-4469/aeqgo?a=view
    which mentions:
    C4043
    Message Illegal character used in property name - {0}
    {0} is replaced with the illegal character used.
    Cause An attempt was made to use a property name containing an illegal character. See JMS Message API Javadoc for valid property names.we are sometimes hitting this problem.
    e.g. '1' is not valid or strings with '-' but what else what else?
    i am migrating a huge application from STCMS (which allowed such property names) to SJSMQ and i would like to know exactly what is legal and not legal. does anyone know?
    regards chris

    Also ... look @ the description for what is a valid property in the JMS javadocs for Message:
    http://java.sun.com/javaee/5/docs/api/
    The key section is the fact that it must confirm to a selector identifier (covered later in the page). Here is part of an except that may help
    An identifier is an unlimited-length sequence of letters and digits, the first of which must be a letter. A letter is any character for which the method Character.isJavaLetter returns true. This includes '_' and '$'. A letter or digit is any character for which the method Character.isJavaLetterOrDigit returns true. the JMS specification ...

  • XML Error - Illegal character or entity reference syntax

    Illegal character or entity reference syntax.
    Illegal character or entity reference syntax.
    The error occurred in D:\Docwf\dashboard\dsp_TestXML.cfm:
    line 80
    Called from D:\Docwf\dashboard\fbx_Switch.cfm: line 357
    Called from D:\Docwf\dashboard\fbx_Switch.cfm: line 1
    Called from D:\Docwf\fbx_fusebox30_CF50.cfm: line 241
    Called from D:\Docwf\fbx_fusebox30_CF50.cfm: line 1
    Called from D:\Docwf\fbx_fusebox30_CF50.cfm: line 1
    Called from D:\Docwf\index.cfm: line 37
    78 :
    <ProjectNo>#nqOffTimeExp.prProjNo#</ProjectNo>
    79 :
    80 : </cfloop>
    81 : </AccountPayable>
    82 :
    This is the error page and my code is attached below. As you
    can see in the code there are two instances where I am creating XML
    files. In the first case I am not getting any error but in the
    second case I get the error . Any ideas ???
    Thanks.
    CODE:

    Change this:
    <Description>#nqOffTimeExp.iddescript#</Description>
    <FirstName>#nqOffTimeExp.eoFirst#</FirstName>
    <LastName>#nqOffTimeExp.eoLast#</LastName>
    <ChargeDate>#nqOffTimeExp.idchargesdt#</ChargeDate>
    <BillCode>#nqOffTimeExp.idbillcode#</BillCode>
    <ProjectNo>#nqOffTimeExp.prProjNo#</ProjectNo>
    To this:
    <Description>#
    XmlFormat (nqOffTimeExp.iddescript)#</Description>
    <FirstName>#
    XmlFormat (nqOffTimeExp.eoFirst)#</FirstName>
    <LastName>#
    XmlFormat (nqOffTimeExp.eoLast)#</LastName>
    <ChargeDate>#
    XmlFormat (nqOffTimeExp.idchargesdt)#</ChargeDate>
    <BillCode>#
    XmlFormat (nqOffTimeExp.idbillcode)#</BillCode>
    <ProjectNo>#
    XmlFormat (nqOffTimeExp.prProjNo)#</ProjectNo>

  • Can you solve the error ? FlashBuilder 4 :launch failed : Illegal character in path at index 41

    Hi
    when I am going to run an application (even a simple blank mxml one) ,  the flashbulider is saying the follows:
    Launch failed
    Illegal character in path at index 41
    file:///......bin-debug/Main.html

    cant access your stuff maybe paste it in pastie.org

  • Illegal character '%' at position 1 - need help with perl script!

    iTunes U Access Debugging
    Received
    Destination kean.edu
    Identity %22Jack Black%22 %3C%28jblack%29.%40kean.edu%3E %28jblack%29 %5B42%5D
    Credentials STUDENT%40urn%3Amace%3Aitunesu.com%3Asites%3Akean.edu
    Time 1178737992
    Signature 8786768fc3ebf9d3faf404a42bdb8a8d14c481e270fb75f084ebdd815553e1e4
    Analysis
    The destination string is valid and the corresponding destination item was found.
    The identity string is invalid: Illegal character '%' at position 1.
    The credential string is valid but contains no known credentials.
    The credential string contains the following credential which is not used within iTunes U:
    STUDENT%40urn%3Amace%3Aitunesu.com%3Asites%3Akean.edu
    The time string is valid and corresponds to 2007-05-09 19:13:12Z.
    The signature string is valid.
    Access
    Because the received signature and time were valid, the received identity and credentials were accepted by iTunes U.
    In addition, the following 2 credentials were automatically added by iTunes U:
    All@urn:mace:itunesu.com:sites:kean.edu
    Authenticated@urn:mace:itunesu.com:sites:kean.edu
    With these credentials, you have browsing and downloading access to the requested destination.

    Ken
    Thanks for lookiing into the issue.
    I am using the perl file downloaded from the iTunesU website.
    Here is the script:
    the only thing i replaced in this script is the shared secret, debug suffix, display name, email address and username with appropriate ones.
    use strict;
    use Digest::SHA qw(hmacsha256hex);
    use URI::Escape;
    use LWP::UserAgent;
    use Encode qw(encode);
    # to redirect errors to the browser
    use CGI::Carp qw(fatalsToBrowser);
    # to allow inputs from website using CGI scripting
    use CGI qw(:standard);
    sub main() {
    # Define your site's information. Replace these
    # values with ones appropriate for your site.
    my $siteURL = "https://deimos.apple.com/WebObjects/Core.woa/Browse/kean.edu";
    my $debugSuffix = "/abc123";
    my $sharedSecret = "YOURSHAREDSECRETKEYCODE";
    my $administratorCredential = "Administrator\@urn:mace:itunesu.com:sites:kean.edu";
    # Define the user information. Replace the credentials with the
    # credentials you want to grant to that user, and the optional
    # identity information with the identity of the current user.
    # For initial testing and site setup, use the singe administrator
    # credential defined when your iTunes U site was created. Once
    # you have access to your iTunes U site, you will be able to define
    # additional credentials and the iTunes U access they provide.
    my @credentialArray = ($administratorCredential);
    my $displayName = "Michael Searson";
    my $emailAddress = "msearson\@kean.edu";
    my $username = "msearson";
    my $userIdentifier = "42";
    # Append your site's debug suffix to the destination if you
    # want to receive an HTML page providing information about
    # the transmission of credentials and identity between this
    # program and iTunes U. Remove this code after initial
    # testing to instead receive the destination page requested.
    # uncomment the line below to access debug information from the
    # iTunes U server.
    $siteURL .= $debugSuffix;
    # Ready this data for transfer, the order must be correct!
    my $identity = getIdentityString($displayName, $emailAddress, $username, $userIdentifier);
    # turn the array of credentials into a semicolon delimited string
    my $credentials = getCredentialsString(@credentialArray);
    # time that this key is generated. The key is valid for 90 seconds.
    my $currentTime = time;
    my %token = getAuthorizationToken($identity, $credentials, $currentTime, $sharedSecret);
    invokeAction($siteURL, %token)
    sub getIdentityString()
    # Combine user identity information into an appropriately formatted string.
    # take the arguments passed into the function copy them to variables
    my ($displayName, $emailAddress, $username, $userIdentifier) = @_;
    # wrap the elements into the required delimiters.
    my $returnValue = sprintf('"%s" <%s> (%s) [%s]', $displayName,
    $emailAddress, $username, $userIdentifier);
    return $returnValue;
    sub getCredentialsString()
    # this is equivalent to join(';', @_); this function is present
    # for consistency with the Java example.
    # concatenates all the passed in credentials into a string
    # with a semicolon delimiting the credentials in the string.
    #make sure that at least one credential is passed in
    my $returnValue = "";
    my $credentialCount = @_;
    if ($credentialCount > 0) {
    for (my $i=0; $i < $credentialCount; $i++) {
    if ($i == 0) {
    $returnValue = sprintf('%s', $_[$i]);
    } else {
    $returnValue = sprintf('%s;%s', $returnValue, $_[$i]);
    } else {
    die "credentialArray must have at least one credential";
    return $returnValue;
    sub getAuthorizationToken()
    # Create a buffer with which to generate the authorization token.
    my ($identity, $credentials, $expriation, $key) = @_;
    my $signature;
    my $buffer;
    my %token_hash = ();
    my $escapedUTF8EncodedCredentials = uri_escape(encode("UTF-8", $credentials), "^A-Za-z0-9\-_.* ");
    my $escapedUTF8EncodedIdentity = uri_escape(encode("UTF-8", $identity), "^A-Za-z0-9\-_.* ");
    my $escapedUTF8EncodedExpiration = uri_escape(encode("UTF-8", $expriation), "^A-Za-z0-9\-_.* ");
    # create the POST Content and sign it
    $buffer .= "credentials=" . $escapedUTF8EncodedCredentials;
    $buffer .= "&identity=" . $escapedUTF8EncodedIdentity;
    $buffer .= "&time=" . $escapedUTF8EncodedExpiration;
    # This is necessary because uri_escape does encode spaces to pluses.
    $buffer =~ s/[ ]/+/g;
    # returns a signed message that is sent to the server
    $signature = hmacsha256hex($buffer, $key);
    $token_hash{'credentials'} = $escapedUTF8EncodedCredentials;
    $token_hash{'identity'} = $escapedUTF8EncodedIdentity;
    $token_hash{'time'} = $escapedUTF8EncodedExpiration;
    $token_hash{'signature'} = $signature;
    # append the signature to the POST content
    return %token_hash
    sub invokeAction()
    # Send a request to iTunes U and record the response.
    # Net:HTTPS is used to get better control of the encoding of the POST data
    # as HTTP::Request::Common does not encode parentheses and Java's URLEncoder
    # does.
    my ($siteURL, %token) = @_;
    #print "$token\n";
    my $ua = LWP::UserAgent->new;
    my $response = $ua->post($siteURL, \%token);
    print "Content-type: text/html\n\n";
    print $response->content;
    main();
    AND HERE IS THE OUTPUT
    Received
    Destination kean.edu
    Identity %22Michael Searson%22 %3Cmsearson%40kean.edu%3E %28msearson%29 %5B42%5D
    Credentials Administrator%40urn%3Amace%3Aitunesu.com%3Asites%3Akean.edu
    Time 1178819683
    Signature 4d012f2cb6e465dbc4ae41b4905ad3c334c695e36b06e9ae406acf02f25387d1
    Analysis
    The destination string is valid and the corresponding destination item was found.
    The identity string is invalid: Illegal character '%' at position 1.
    The credential string is valid but contains no known credentials.
    The credential string contains the following credential which is not used within iTunes U:
    Administrator%40urn%3Amace%3Aitunesu.com%3Asites%3Akean.edu
    The time string is valid and corresponds to 2007-05-10 17:54:43Z.
    The signature string is valid.
    Access
    Because the received signature and time were valid, the received identity and credentials were accepted by iTunes U.
    In addition, the following 2 credentials were automatically added by iTunes U:
    All@urn:mace:itunesu.com:sites:kean.edu
    Authenticated@urn:mace:itunesu.com:sites:kean.edu
    With these credentials, you have browsing, downloading, uploading, and editing access to the requested destination.

  • Finder Quits on viewing illegal Character

    I have a G5 that the Finder will quit ever time I open a folder that contains a file with an illegal charcter. I have others machines that can open the same folder with no problems. I have tried to create a new users on this machine, but still the finder quits when trying to view the file.
    Is there a plist that is corrupt?

    Hi Jason,
    if you're worried about a corrupt plist file, take a look at Preferential Treatment...
    http://www.versiontracker.com/dyn/moreinfo/macosx/22790
    now, i would get rid of the illegal character... it's illegal for a reason - so the fact the other machines don't care shouldn't be your focus... you should instead focus on renaming that folder...
    you can do that using Applications > Utilities > Terminal.
    if you tell me where that folder is, and what its name is, i could give you the command to use...
    cheers

Maybe you are looking for

  • EP 7.0 with SSO to ITS 6.10

    Hello, we have conacted a EP 7.0 SP12 over an iview to an ITS 6.10, which then use rfc to connect ess/mss from an old sap server 620. We implemented SSO. If we access the ITS over the portal we see the login screen from the ITS. We are able to login

  • Amount of registered contacts

    Please help me: How do I Know the amount of registered contacts in my BB Torch 9800? Seems that they are different from the registered in Outlook. As a matter of fact, i have not been able to match both of them. I am retired from my company and am by

  • Mouse lags

    My apologies if this has been discussed elsewhere. I have looked but to no avail. I am using the 2011 new iMac i5 with 12 GB of RAM and I have tried a wired A4tech Mouse (heavy lag) and a Genius wireless mouse. I am using Windows 7 via boot camp. I o

  • Export to PDF and Paper size

    Hi, I am using Crystal reports 10 and am exporting the report to pdf. I have set PrintOptions.PaperSize = PaperSize.PaperLegal in the asp.net code. The exported pdf looks good according to the paper size set but when I print the pdf it is printing in

  • Automatically Create An Activities From Opportunity?

    How Automatically Create An Activities From Opportunity use the 'Create Follow-up' '? IF  you have some ideas ,please tell me ,thanks!